1 /** 2 hdf5.bindings 3 4 D Language bindings to the HDF5 Library. (Paired with a set of high-level wrappers) 5 https://github.com/Laeeth/d_hdf5 6 No restriction on use beyond those applying from HDF5 and the original C API by Stefan Frijters 7 However, if you use them, I would not mind knowing your application and suggestions for 8 improvement if you feel like sharing. laeeth@laeeth.com 9 10 11 12 Copyright by The HDF Group. * 13 Copyright by the Board of Trustees of the University of Illinois. * 14 All rights reserved. * 15 * 16 This file is part of HDF5. The full HDF5 copyright notice, including * 17 terms governing use, modification, and redistribution, is contained in * 18 the files COPYING and Copyright.html. COPYING can be found at the root * 19 of the source code distribution tree; Copyright.html can be found at the * 20 root level of an installed copy of the electronic HDF5 document set and * 21 is linked from the top-level documents page. It can also be found at * 22 http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * 23 access to either file, you may request a copy from help@hdfgroup.org. * 24 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 25 Ported to D by Laeeth Isharc 2014 26 Borrowed heavily in terms of C API declarations from https://github.com/SFrijters/hdf5-d 27 Stefan Frijters bindings for D 28 29 Bindings probably not yet complete or bug-free. 30 31 Consider this not even alpha stage. It probably isn't so far away from being useful though. 32 This is written for Linux and will need modification to work on other platforms. 33 */ 34 35 module hdf5.bindings; 36 public import core.stdc.stdint; 37 public import core.sys.posix.sys.types: off_t; 38 public import core.stdc.time; 39 public import core.stdc.stdint; 40 import std.conv; 41 import std..string; 42 import std.array; 43 import std.stdio; 44 45 enum h5parallel=0; 46 47 enum H5_VERS_MAJOR = 1; /* For major interface/format changes */ 48 enum H5_VERS_MINOR = 8; /* For minor interface/format changes */ 49 enum H5_VERS_RELEASE = 14; /* For tweaks, bug-fixes, or development */ 50 enum H5_VERS_SUBRELEASE = ""; /* For pre-releases like snap0 */ 51 /* Empty string for real releases. */ 52 enum H5_VERS_INFO = "HDF5 library version: 1.8.14"; /* Full version string */ 53 54 auto H5check() { 55 return H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, H5_VERS_RELEASE); 56 } 57 58 /* macros for comparing the version */ 59 bool H5_VERSION_GE(Maj,Min,Rel)() { 60 return (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || 61 ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || 62 (H5_VERS_MAJOR>Maj)); 63 } 64 65 bool H5_VERSION_LE(Maj,Min,Rel)() { 66 return (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE<=Rel)) || 67 ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR<Min)) || 68 (H5_VERS_MAJOR<Maj)); 69 } 70 alias herr_t = int; 71 alias hbool_t = uint; 72 alias htri_t = int; 73 74 static if ( H5_SIZEOF_SIZE_T==H5_SIZEOF_INT ) { 75 alias ssize_t = int; 76 } 77 else static if ( H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG ) { 78 alias ssize_t = long; 79 } 80 else static if ( H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG ) { 81 alias ssize_t = long; 82 } 83 else { 84 static assert(0, "nothing appropriate for ssize_t"); 85 } 86 87 alias hsize_t = ulong; 88 alias hssize_t = long; 89 90 static if (H5_SIZEOF_INT64_T >= 8 ) { 91 alias haddr_t = uint64_t; 92 enum HADDR_UNDEF = ( cast(haddr_t) cast(int64_t)(-1)); 93 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_INT64_T; 94 enum HADDR_AS_MPI_TYPE = MPI_LONG_LONG_INT; 95 } 96 else static if (H5_SIZEOF_INT >= 8 ) { 97 alias haddr_t = uint; 98 enum HADDR_UNDEF = (cast(haddr_t)(-1)); 99 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_INT; 100 enum HADDR_AS_MPI_TYPE = MPI_UNSIGNED; 101 } 102 else static if (H5_SIZEOF_LONG >= 8 ) { 103 alias haddr_t = ulong; 104 enum HADDR_UNDEF = (cast(haddr_t) cast(long)(-1)); 105 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_LONG; 106 enum HADDR_AS_MPI_TYPE = MPI_UNSIGNED_LONG; 107 } 108 else static if (H5_SIZEOF_LONG_LONG >= 8 ) { 109 alias haddr_t = ulong; 110 enum HADDR_UNDEF = (cast(haddr_t) cast(long)(-1)); 111 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_LONG_LONG; 112 enum HADDR_AS_MPI_TYPE = MPI_LONG_LONG_INT; 113 } 114 else { 115 static assert(0, "nothing appropriate for haddr_t"); 116 } 117 118 static if ( H5_SIZEOF_UINT64_T>=8 ) { } 119 else static if ( H5_SIZEOF_INT>=8 ) { 120 alias uint64_t = uint; 121 enum H5_SIZEOF_UINT64_T = H5_SIZEOF_INT; 122 } 123 else static if ( H5_SIZEOF_LONG>=8 ) { 124 alias uint64_t = uint; 125 enum H5_SIZEOF_UINT64_T = H5_SIZEOF_LONG; 126 } 127 else static if ( H5_SIZEOF_LONG_LONG>=8 ) { 128 alias uint64_t = ulong; 129 enum H5_SIZEOF_UINT64_T = H5_SIZEOF_LONG_LONG; 130 } 131 else { 132 static assert(0, "nothing appropriate for uint64_t"); 133 } 134 135 /* Default value for all property list classes */ 136 enum H5P_DEFAULT = 0; 137 138 /* Common iteration orders */ 139 enum H5IterOrder 140 { 141 Unknown = -1, /* Unknown order */ 142 Inc, /* Increasing order */ 143 Dec, /* Decreasing order */ 144 Native, /* No particular order, whatever is fastest */ 145 N /* Number of iteration orders */ 146 } 147 148 /* Iteration callback values */ 149 /* (Actually, any postive value will cause the iterator to stop and pass back 150 * that positive value to the function that called the iterator) 151 */ 152 enum H5_ITER_ERROR = (-1); 153 enum H5_ITER_CONT = (0); 154 enum H5_ITER_STOP = (1); 155 156 /* 157 * The types of indices on links in groups/attributes on objects. 158 * Primarily used for "<do> <foo> by index" routines and for iterating over 159 * links in groups/attributes on objects. 160 */ 161 enum H5Index { 162 Unknown = -1, /* Unknown index type */ 163 Name, /* Index on names */ 164 CRTOrder, /* Index on creation order */ 165 N /* Number of indices defined */ 166 } 167 168 /* 169 * Storage info struct used by H5O_info_t and H5F_info_t 170 */ 171 align(1) 172 { 173 struct H5_ih_info_t { 174 hsize_t index_size; /* btree and/or list */ 175 hsize_t heap_size; 176 } 177 } 178 /* Functions in H5.c */ 179 version(Posix) 180 { 181 extern(C) 182 { 183 herr_t H5open(); 184 herr_t H5close(); 185 herr_t H5dont_atexit(); 186 herr_t H5garbage_collect(); 187 herr_t H5set_free_list_limits (int reg_global_lim, int reg_list_lim, 188 int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); 189 herr_t H5get_libversion(uint *majnum, uint *minnum, uint *relnum); 190 herr_t H5check_version(uint majnum, uint minnum, uint relnum); 191 herr_t H5free_memory(void *mem); 192 } 193 } 194 195 string ZtoString(const char[] c) 196 { 197 return to!string(fromStringz(cast(char*)c)); 198 } 199 200 string ZtoString(const char* c) 201 { 202 return to!string(fromStringz(c)); 203 } 204 205 enum H5AC__CURR_CACHE_CONFIG_VERSION =1; 206 enum H5AC__MAX_TRACE_FILE_NAME_LEN =1024; 207 208 enum H5AC_METADATA 209 { 210 WRITE_STRATEGY__PROCESS_0_ONLY =0, 211 WRITE_STRATEGY__DISTRIBUTED =1, 212 } 213 struct H5ACCacheConfig 214 { 215 align(1) 216 { 217 /* general configuration fields: */ 218 int ver; 219 220 hbool_t rpt_fcn_enabled; 221 222 hbool_t open_trace_file; 223 hbool_t close_trace_file; 224 char[H5AC__MAX_TRACE_FILE_NAME_LEN + 1] trace_file_name; 225 226 hbool_t evictions_enabled; 227 228 hbool_t set_initial_size; 229 size_t initial_size; 230 231 double min_clean_fraction; 232 233 size_t max_size; 234 size_t min_size; 235 236 long epoch_length; 237 238 239 /* size increase control fields: */ 240 //enum H5C_cache_incr_mode=incr_mode; 241 242 double lower_hr_threshold; 243 244 double increment; 245 246 hbool_t apply_max_increment; 247 size_t max_increment; 248 249 //enum H5C_cache_flash_incr_mode =flash_incr_mode; 250 double flash_multiple; 251 double flash_threshold; 252 253 254 /* size decrease control fields: */ 255 //enum H5C_cache_decr_mode decr_mode; 256 257 double upper_hr_threshold; 258 259 double decrement; 260 261 hbool_t apply_max_decrement; 262 size_t max_decrement; 263 264 int epochs_before_eviction; 265 266 hbool_t apply_empty_reserve; 267 double empty_reserve; 268 269 270 /* parallel configuration fields: */ 271 int dirty_bytes_threshold; 272 int metadata_write_strategy; 273 } 274 } 275 276 277 278 279 /*****************/ 280 /* Public Macros */ 281 /*****************/ 282 283 /* Macros used to "unset" chunk cache configuration parameters */ 284 enum H5D_CHUNK_CACHE_NSLOTS_DEFAULT = (cast(size_t) -1); 285 enum H5D_CHUNK_CACHE_NBYTES_DEFAULT = (cast(size_t) -1); 286 enum H5D_CHUNK_CACHE_W0_DEFAULT = -1.; 287 288 /* Property names for H5LTDdirect_chunk_write */ 289 enum H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME = "direct_chunk_flag"; 290 enum H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME = "direct_chunk_filters"; 291 enum H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME = "direct_chunk_offset"; 292 enum H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME = "direct_chunk_datasize"; 293 294 /*******************/ 295 /* Public Typedefs */ 296 /*******************/ 297 298 /* Values for the H5D_LAYOUT property */ 299 enum H5DLayout 300 { 301 Error = -1, 302 303 Compact = 0, /*raw data is very small */ 304 Contiguous = 1, /*the default */ 305 Chunked = 2, /*slow and fancy */ 306 Nlayouts = 3 /*this one must be last! */ 307 } 308 309 /* Types of chunk index data structures */ 310 enum H5D_chunk_index_t { 311 H5D_CHUNK_BTREE = 0 /* v1 B-tree index */ 312 } 313 314 /* Values for the space allocation time property */ 315 enum H5DAllocTime { 316 Error = -1, 317 Default = 0, 318 Early = 1, 319 Late = 2, 320 Incr = 3 321 } 322 323 /* Values for the status of space allocation */ 324 enum H5DSpaceStatus 325 { 326 Error = -1, 327 NotAllocated = 0, 328 PartAllocated = 1, 329 Allocated = 2 330 } 331 332 /* Values for time of writing fill value property */ 333 enum H5D_fill_time_t { 334 H5D_FILL_TIME_ERROR = -1, 335 H5D_FILL_TIME_ALLOC = 0, 336 H5D_FILL_TIME_NEVER = 1, 337 H5D_FILL_TIME_IFSET = 2 338 } 339 340 /* Values for fill value status */ 341 enum H5D_fill_value_t { 342 H5D_FILL_VALUE_ERROR =-1, 343 H5D_FILL_VALUE_UNDEFINED =0, 344 H5D_FILL_VALUE_DEFAULT =1, 345 H5D_FILL_VALUE_USER_DEFINED =2 346 } 347 348 /*********************/ 349 /* Public Prototypes */ 350 /*********************/ 351 352 /* Define the operator function pointer for H5Diterate() */ 353 extern(C) 354 { 355 alias H5D_operator_t = herr_t function(void *elem, hid_t type_id, int ndim, const hsize_t *point, void *operator_data); 356 /* Define the operator function pointer for H5Dscatter() */ 357 alias H5D_scatter_func_t = herr_t function(const void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/, void *op_data); 358 /* Define the operator function pointer for H5Dgather() */ 359 alias H5D_gather_func_t = herr_t function(const void *dst_buf, size_t dst_buf_bytes_used, void *op_data); 360 version(Posix) { 361 hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, 362 hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id); 363 hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id, hid_t plist_id, hid_t dapl_id); 364 hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id); 365 herr_t H5Dclose(hid_t dset_id); 366 hid_t H5Dget_space(hid_t dset_id); 367 herr_t H5Dget_space_status(hid_t dset_id, H5DSpaceStatus *allocation); 368 hid_t H5Dget_type(hid_t dset_id); 369 hid_t H5Dget_create_plist(hid_t dset_id); 370 hid_t H5Dget_access_plist(hid_t dset_id); 371 hsize_t H5Dget_storage_size(hid_t dset_id); 372 haddr_t H5Dget_offset(hid_t dset_id); 373 herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/); 374 herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf); 375 herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data); 376 herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf); 377 herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size); 378 herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf, hid_t buf_type, hid_t space); 379 herr_t H5Dset_extent(hid_t dset_id, const hsize_t* size); 380 herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf); 381 herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data); 382 herr_t H5Ddebug(hid_t dset_id); 383 } 384 385 386 387 /* Information struct for attribute (for H5Aget_info/H5Aget_info_by_idx) */ 388 align(1) 389 { 390 struct H5A_info_t { 391 hbool_t corder_valid; /* Indicate if creation order is valid */ 392 H5O_msg_crt_idx_t corder; /* Creation order */ 393 H5TCset cset; /* Character set of attribute name */ 394 hsize_t data_size; /* Size of raw data */ 395 } 396 } 397 // Typedef for H5Aiterate2() callbacks 398 extern(C) 399 { 400 alias H5A_operator2_t = herr_t function(hid_t location_id/*in*/, const char *attr_name/*in*/, const H5A_info_t *ainfo/*in*/, void *op_data/*in,out*/); 401 } 402 version(Posix) 403 { 404 extern(C) 405 { 406 // Public function prototypes 407 408 hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id); 409 hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, 410 hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id); 411 hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id); 412 hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, hid_t lapl_id); 413 hid_t H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t aapl_id, 414 hid_t lapl_id); 415 herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf); 416 herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf); 417 herr_t H5Aclose(hid_t attr_id); 418 hid_t H5Aget_space(hid_t attr_id); 419 hid_t H5Aget_type(hid_t attr_id); 420 hid_t H5Aget_create_plist(hid_t attr_id); 421 ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf); 422 ssize_t H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, 423 char *name /*out*/, size_t size, hid_t lapl_id); 424 hsize_t H5Aget_storage_size(hid_t attr_id); 425 herr_t H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/); 426 herr_t H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo /*out*/, hid_t lapl_id); 427 herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, 428 H5A_info_t *ainfo /*out*/, hid_t lapl_id); 429 herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name); 430 herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id); 431 herr_t H5Aiterate2(hid_t loc_id, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5A_operator2_t op, void *op_data); 432 herr_t H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t *idx, 433 H5A_operator2_t op, void *op_data, hid_t lapd_id); 434 herr_t H5Adelete(hid_t loc_id, const char *name); 435 herr_t H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id); 436 herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id); 437 htri_t H5Aexists(hid_t obj_id, const char *attr_name); 438 htri_t H5Aexists_by_name(hid_t obj_id, const char *obj_name, const char *attr_name, hid_t lapl_id); 439 } 440 } 441 442 443 enum H5D_ONE_LINK_CHUNK_IO_THRESHOLD = 0; 444 enum H5D_MULTI_CHUNK_IO_COL_THRESHOLD = 60; 445 enum H5FDMPIO { 446 Independent = 0, /*zero is the default*/ 447 Collective 448 } 449 450 /* Type of chunked dataset I/O */ 451 enum H5FDMPIOChunkOptions 452 { 453 Default = 0, 454 OneIO, /*zero is the default*/ 455 MultiIO 456 } 457 458 /* Type of collective I/O */ 459 460 alias H5FD_MPIO=H5FD_mpio_init; 461 462 463 464 static if (H5_HAVE_PARALLEL) 465 { 466 enum H5F_DEBUG = true; 467 } 468 469 /* Global var whose value comes from environment variable */ 470 /* (Defined in H5FDmpio.c) */ 471 extern __gshared hbool_t H5FD_mpi_opt_types_g; 472 473 version(Posix) { 474 475 /* Function prototypes */ 476 hid_t H5FD_mpio_init(); 477 void H5FD_mpio_term(); 478 herr_t H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info); 479 herr_t H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/); 480 herr_t H5Pset_dxpl_mpio(hid_t dxpl_id, H5FDMPIO xfer_mode); 481 herr_t H5Pget_dxpl_mpio(hid_t dxpl_id, H5FDMPIO *xfer_mode/*out*/); 482 herr_t H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FDMPIO opt_mode); 483 herr_t H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FDMPIOChunkOptions opt_mode); 484 herr_t H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, uint num_chunk_per_proc); 485 herr_t H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, uint percent_num_proc_per_chunk); 486 } 487 } 488 489 490 491 /* 492 * These are the bits that can be passed to the `flags' argument of 493 * H5Fcreate() and H5Fopen(). Use the bit-wise OR operator (|) to combine 494 * them as needed. As a side effect, they call H5check_version() to make sure 495 * that the application is compiled with a version of the hdf5 header files 496 * which are compatible with the library to which the application is linked. 497 * We're assuming that these constants are used rather early in the hdf5 498 * session. 499 * 500 */ 501 enum H5F_ACC_RDONLY = 0x0000u; /*absence of rdwr => rd-only */ 502 enum H5F_ACC_RDWR = 0x0001u; /*open for read and write */ 503 enum H5F_ACC_TRUNC = 0x0002u; /*overwrite existing files */ 504 enum H5F_ACC_EXCL = 0x0004u; /*fail if file already exists*/ 505 enum H5F_ACC_DEBUG = 0x0008u; /*print debug info */ 506 enum H5F_ACC_CREAT = 0x0010u; /*create non-existing files */ 507 508 /* Value passed to H5Pset_elink_acc_flags to cause flags to be taken from the 509 * parent file. */ 510 enum H5F_ACC_DEFAULT = 0xffffu; /*ignore setting on lapl */ 511 512 /* Flags for H5Fget_obj_count() & H5Fget_obj_ids() calls */ 513 enum H5F_OBJ_FILE = 0x0001u; /* File objects */ 514 enum H5F_OBJ_DATASET = 0x0002u; /* Dataset objects */ 515 enum H5F_OBJ_GROUP = 0x0004u; /* Group objects */ 516 enum H5F_OBJ_DATATYPE= 0x0008u; /* Named datatype objects */ 517 enum H5F_OBJ_ATTR = 0x0010u; /* Attribute objects */ 518 enum H5F_OBJ_ALL = (H5F_OBJ_FILE|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR); 519 enum H5F_OBJ_LOCAL = 0x0020u; /* Restrict search to objects opened through current file ID */ 520 /* (as opposed to objects opened through any file ID accessing this file) */ 521 522 523 enum H5F_FAMILY_DEFAULT = cast(hsize_t) 0; 524 525 /* 526 * Use this constant string as the MPI_Info key to set H5Fmpio debug flags. 527 * To turn on H5Fmpio debug flags, set the MPI_Info value with this key to 528 * have the value of a string consisting of the characters that turn on the 529 * desired flags. 530 */ 531 enum H5F_MPIO_DEBUG_KEY = "H5F_mpio_debug_key"; 532 533 /* The difference between a single file and a set of mounted files */ 534 enum H5F_scope_t { 535 H5F_SCOPE_LOCAL = 0, /*specified file handle only */ 536 H5F_SCOPE_GLOBAL = 1 /*entire virtual file */ 537 } 538 539 /* Unlimited file size for H5Pset_external() */ 540 enum H5F_UNLIMITED = (cast(hsize_t)(-1L)); 541 542 /* How does file close behave? 543 * H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL 544 * H5F_CLOSE_WEAK - file closes only after all opened objects are closed 545 * H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file 546 close fails 547 * H5F_CLOSE_STRONG - if there are opened objects, close them first, then 548 close file 549 */ 550 enum H5F_close_degree_t { 551 H5F_CLOSE_DEFAULT = 0, 552 H5F_CLOSE_WEAK = 1, 553 H5F_CLOSE_SEMI = 2, 554 H5F_CLOSE_STRONG = 3 555 } 556 557 /* Current "global" information about file */ 558 /* (just size info currently) */ 559 align(1) 560 { 561 struct H5F_info_t { 562 hsize_t super_ext_size; /* Superblock extension size */ 563 struct { 564 hsize_t hdr_size; /* Shared object header message header size */ 565 H5_ih_info_t msgs_info; /* Shared object header message index & heap size */ 566 }; 567 } 568 } 569 570 /* 571 * Types of allocation requests. The values larger than H5FD_MEM_DEFAULT 572 * should not change other than adding new types to the end. These numbers 573 * might appear in files. 574 * 575 * Note: please change the log VFD flavors array if you change this 576 * enumeration. 577 */ 578 enum H5F_mem_t { 579 H5FD_MEM_NOLIST = -1, /* Data should not appear in the free list. 580 * Must be negative. 581 */ 582 H5FD_MEM_DEFAULT = 0, /* Value not yet set. Can also be the 583 * datatype set in a larger allocation 584 * that will be suballocated by the library. 585 * Must be zero. 586 */ 587 H5FD_MEM_SUPER = 1, /* Superblock data */ 588 H5FD_MEM_BTREE = 2, /* B-tree data */ 589 H5FD_MEM_DRAW = 3, /* Raw data (content of datasets, etc.) */ 590 H5FD_MEM_GHEAP = 4, /* Global heap data */ 591 H5FD_MEM_LHEAP = 5, /* Local heap data */ 592 H5FD_MEM_OHDR = 6, /* Object header data */ 593 594 H5FD_MEM_NTYPES /* Sentinel value - must be last */ 595 } 596 597 /* Library's file format versions */ 598 enum H5F_libver_t { 599 H5F_LIBVER_EARLIEST, /* Use the earliest possible format for storing objects */ 600 H5F_LIBVER_LATEST /* Use the latest possible format available for storing objects*/ 601 } 602 603 /* Define file format version for 1.8 to prepare for 1.10 release. 604 * (Not used anywhere now)*/ 605 // #define H5F_LIBVER_18 H5F_LIBVER_LATEST 606 607 /* Functions in H5F.c */ 608 version(Posix) { 609 extern(C) 610 { 611 htri_t H5Fis_hdf5(const char *filename); 612 hid_t H5Fcreate(const char *filename, uint flags, hid_t create_plist, hid_t access_plist); 613 hid_t H5Fopen(const char *filename, uint flags, hid_t access_plist); 614 hid_t H5Freopen(hid_t file_id); 615 herr_t H5Fflush(hid_t object_id, H5F_scope_t _scope); 616 herr_t H5Fclose(hid_t file_id); 617 hid_t H5Fget_create_plist(hid_t file_id); 618 hid_t H5Fget_access_plist(hid_t file_id); 619 herr_t H5Fget_intent(hid_t file_id, uint * intent); 620 ssize_t H5Fget_obj_count(hid_t file_id, uint types); 621 ssize_t H5Fget_obj_ids(hid_t file_id, uint types, size_t max_objs, hid_t *obj_id_list); 622 herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle); 623 herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); 624 herr_t H5Funmount(hid_t loc, const char *name); 625 hssize_t H5Fget_freespace(hid_t file_id); 626 herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); 627 ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); 628 herr_t H5Fget_mdc_hit_rate(hid_t file_id, double * hit_rate_ptr); 629 herr_t H5Fget_mdc_size(hid_t file_id, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, int * cur_num_entries_ptr); 630 herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id); 631 ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size); 632 herr_t H5Fget_info(hid_t obj_id, H5F_info_t *bh_info); 633 herr_t H5Fclear_elink_file_cache(hid_t file_id); 634 version(h5parallel) herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); 635 version(h5parallel) herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); 636 } 637 } 638 639 enum H5GStorageType { 640 Unknown = -1, /* Unknown link storage type */ 641 SymbolTable, /* Links in group are stored with a "symbol table" */ 642 /* (this is sometimes called "old-style" groups) */ 643 Compact, /* Links are stored in object header */ 644 Dense /* Links are stored in fractal heap & indexed with v2 B-tree */ 645 } 646 647 /* Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) */ 648 struct H5GInfo { 649 align(1) 650 { 651 H5GStorageType storage_type; /* Type of storage for links in group */ 652 hsize_t nlinks; /* Number of links in group */ 653 long max_corder; /* Current max. creation order value for group */ 654 hbool_t mounted; /* Whether group has a file mounted on it */ 655 } 656 } 657 658 extern(C) 659 { 660 hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id); 661 hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id); 662 hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id); 663 hid_t H5Gget_create_plist(hid_t group_id); 664 herr_t H5Gget_info(hid_t loc_id, H5GInfo *ginfo); 665 herr_t H5Gget_info_by_name(hid_t loc_id, const(char *)name, H5GInfo *ginfo, hid_t lapl_id); 666 herr_t H5Gget_info_by_idx(hid_t loc_id, const(char *)group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5GInfo *ginfo, hid_t lapl_id); 667 herr_t H5Gclose(hid_t group_id); 668 } 669 670 /* 671 * Library type values. Start with `1' instead of `0' because it makes the 672 * tracing output look better when hid_t values are large numbers. Change the 673 * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will 674 * fail otherwise). 675 * 676 * When adding types here, add a section to the 'misc19' test in test/tmisc.c 677 * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in. 678 * 679 */ 680 681 enum H5IType 682 { 683 Uninitialized = (-2), /*uninitialized type */ 684 BadID = (-1), /*invalid Type */ 685 FileObject = 1, /*type ID for File objects */ 686 Group, /*type ID for Group objects */ 687 DataType, /*type ID for Datatype objects */ 688 DataSpace, /*type ID for Dataspace objects */ 689 DataSet, /*type ID for Dataset objects */ 690 Attr, /*type ID for Attribute objects */ 691 Reference, /*type ID for Reference objects */ 692 VirtualFileLayer, /*type ID for virtual file layer */ 693 GenericPropClass, /*type ID for generic property list classes */ 694 GenericPropList, /*type ID for generic property lists */ 695 ErrorClass, /*type ID for error classes */ 696 ErrorMsg, /*type ID for error messages */ 697 ErrorStack, /*type ID for error stacks */ 698 Numtypes /*number of library types, MUST BE LAST! */ 699 } 700 701 /* Type of atoms to return to users */ 702 alias hid_t = int; 703 enum H5_SIZEOF_HID_T = H5_SIZEOF_INT; 704 705 /* An invalid object ID. This is also negative for error return. */ 706 enum H5I_INVALID_HID = (-1); 707 708 /* 709 * Function for freeing objects. This function will be called with an object 710 * ID type number and a pointer to the object. The function should free the 711 * object and return non-negative to indicate that the object 712 * can be removed from the ID type. If the function returns negative 713 * (failure) then the object will remain in the ID type. 714 */ 715 extern(C) 716 { 717 alias H5I_free_t = herr_t function(void*); 718 719 /* Type of the function to compare objects & keys */ 720 alias H5I_search_func_t = int function(void *obj, hid_t id, void *key); 721 } 722 //Public API functions 723 724 version(Posix) 725 { 726 extern(C) 727 { 728 hid_t H5Iregister(H5IType type, const void *object); 729 void *H5Iobject_verify(hid_t id, H5IType id_type); 730 void *H5Iremove_verify(hid_t id, H5IType id_type); 731 H5IType H5Iget_type(hid_t id); 732 hid_t H5Iget_file_id(hid_t id); 733 ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size); 734 int H5Iinc_ref(hid_t id); 735 int H5Idec_ref(hid_t id); 736 int H5Iget_ref(hid_t id); 737 H5IType H5Iregister_type(size_t hash_size, uint reserved, H5I_free_t free_func); 738 herr_t H5Iclear_type(H5IType type, hbool_t force); 739 herr_t H5Idestroy_type(H5IType type); 740 int H5Iinc_type_ref(H5IType type); 741 int H5Idec_type_ref(H5IType type); 742 int H5Iget_type_ref(H5IType type); 743 void *H5Isearch(H5IType type, H5I_search_func_t func, void *key); 744 herr_t H5Inmembers(H5IType type, hsize_t *num_members); 745 htri_t H5Itype_exists(H5IType type); 746 htri_t H5Iis_valid(hid_t id); 747 } 748 } 749 enum H5L_MAX_LINK_NAME_LEN = (cast(uint32_t)(-1)); /* (4GB - 1) */ 750 enum H5L_SAME_LOC = 0; 751 enum H5L_LINK_CLASS_T_VERS = 0; 752 753 /* Link class types. 754 * Values less than 64 are reserved for the HDF5 library's internal use. 755 * Values 64 to 255 are for "user-defined" link class types; these types are 756 * defined by HDF5 but their behavior can be overridden by users. 757 */ 758 enum H5LType { 759 Error = (-1), /* Invalid link type id */ 760 Hard = 0, /* Hard link id */ 761 Soft = 1, /* Soft link id */ 762 External = 64, /* External link id */ 763 Max = 255 /* Maximum link type id */ 764 }; 765 enum H5L_TYPE_BUILTIN_MAX = H5LType.Soft; /* Maximum value link value for "built-in" link types */ 766 enum H5L_TYPE_UD_MIN = H5LType.External; /* Link ids at or above this value are "user-defined" link types. */ 767 768 /* Information struct for link (for H5Lget_info/H5Lget_info_by_idx) */ 769 struct H5LInfo { 770 H5LType type; /* Type of link */ 771 hbool_t corder_valid; /* Indicate if creation order is valid */ 772 int64_t corder; /* Creation order */ 773 H5TCset cset; /* Character set of link name */ 774 union u { 775 haddr_t address; /* Address hard link points to */ 776 size_t val_size; /* Size of a soft link or UD link value */ 777 }; 778 } 779 780 extern(C) 781 { 782 /* The H5L_class_t struct can be used to override the behavior of a 783 * "user-defined" link class. Users should populate the struct with callback 784 * functions defined below. 785 */ 786 /* Callback prototypes for user-defined links */ 787 /* Link creation callback */ 788 alias H5L_create_func_t = herr_t function(const char *link_name, hid_t loc_group, const void *lnkdata, size_t lnkdata_size, hid_t lcpl_id); 789 790 /* Callback for when the link is moved */ 791 alias H5L_move_func_t = herr_t function(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size); 792 793 /* Callback for when the link is copied */ 794 alias H5L_copy_func_t = herr_t function(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size); 795 796 /* Callback during link traversal */ 797 alias H5L_traverse_func_t = herr_t function(const char *link_name, hid_t cur_group, const void *lnkdata, size_t lnkdata_size, hid_t lapl_id); 798 799 /* Callback for when the link is deleted */ 800 alias H5L_delete_func_t = herr_t function(const char *link_name, hid_t file, const void *lnkdata, size_t lnkdata_size); 801 802 /* Callback for querying the link */ 803 /* Returns the size of the buffer needed */ 804 alias H5L_query_func_t = ssize_t function(const char *link_name, const void *lnkdata, size_t lnkdata_size, void *buf /*out*/, size_t buf_size); 805 806 /* User-defined link types */ 807 struct H5L_class_t { 808 int _version; /* Version number of this struct */ 809 H5LType id; /* Link type ID */ 810 const char *comment; /* Comment for debugging */ 811 H5L_create_func_t create_func; /* Callback during link creation */ 812 H5L_move_func_t move_func; /* Callback after moving link */ 813 H5L_copy_func_t copy_func; /* Callback after copying link */ 814 H5L_traverse_func_t trav_func; /* Callback during link traversal */ 815 H5L_delete_func_t del_func; /* Callback for link deletion */ 816 H5L_query_func_t query_func; /* Callback for queries */ 817 } 818 819 /* Prototype for H5Literate/H5Literate_by_name() operator */ 820 alias H5L_iterate_t = herr_t function(hid_t group, const char *name, const H5LInfo *info, void *op_data); 821 822 /* Callback for external link traversal */ 823 alias H5L_elink_traverse_t = herr_t function(const char *parent_file_name, 824 const char *parent_group_name, const char *child_file_name, 825 const char *child_object_name, uint *acc_flags, hid_t fapl_id, 826 void *op_data); 827 } 828 829 /********************/ 830 /* Public Variables */ 831 /********************/ 832 833 version(Posix) 834 { 835 //Public Prototypes 836 extern(C) 837 { 838 herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); 839 herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); 840 herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); 841 herr_t H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id); 842 herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id); 843 herr_t H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id); 844 herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, hid_t lapl_id); 845 herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, void *buf/*out*/, size_t size, hid_t lapl_id); 846 htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id); 847 herr_t H5Lget_info(hid_t loc_id, const char *name, H5LInfo *linfo /*out*/, hid_t lapl_id); 848 herr_t H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5LInfo *linfo /*out*/, hid_t lapl_id); ssize_t H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, char *name /*out*/, size_t size, hid_t lapl_id); 849 herr_t H5Literate(hid_t grp_id, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5L_iterate_t op, void *op_data); 850 herr_t H5Literate_by_name(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5L_iterate_t op, void *op_data, hid_t lapl_id); 851 herr_t H5Lvisit(hid_t grp_id, H5Index idx_type, H5IterOrder order, H5L_iterate_t op, void *op_data); 852 herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, H5L_iterate_t op, void *op_data, hid_t lapl_id); 853 854 /* UD link functions */ 855 herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5LType link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id); 856 herr_t H5Lregister(const H5L_class_t *cls); 857 herr_t H5Lunregister(H5LType id); 858 htri_t H5Lis_registered(H5LType id); 859 860 /* External link functions */ 861 herr_t H5Lunpack_elink_val(const void *ext_linkval/*in*/, size_t link_size, uint *flags, const char **filename/*out*/, const char **obj_path /*out*/); 862 herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id); 863 } 864 } 865 866 867 868 extern(C) 869 { 870 871 /*****************/ 872 /* Public Macros */ 873 /*****************/ 874 875 /* Flags for object copy (H5Ocopy) */ 876 enum H5O_COPY_SHALLOW_HIERARCHY_FLAG = (0x0001u); /* Copy only immediate members */ 877 enum H5O_COPY_EXPAND_SOFT_LINK_FLAG = (0x0002u); /* Expand soft links into new objects */ 878 enum H5O_COPY_EXPAND_EXT_LINK_FLAG = (0x0004u); /* Expand external links into new objects */ 879 enum H5O_COPY_EXPAND_REFERENCE_FLAG = (0x0008u); /* Copy objects that are pointed by references */ 880 enum H5O_COPY_WITHOUT_ATTR_FLAG = (0x0010u); /* Copy object without copying attributes */ 881 enum H5O_COPY_PRESERVE_NULL_FLAG = (0x0020u); /* Copy NULL messages (empty space) */ 882 enum H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG = (0x0040u); /* Merge committed datatypes in dest file */ 883 enum H5O_COPY_ALL =(0x007Fu); /* All object copying flags (for internal checking) */ 884 885 /* Flags for shared message indexes. 886 * Pass these flags in using the mesg_type_flags parameter in 887 * H5P_set_shared_mesg_index. 888 * (Developers: These flags correspond to object header message type IDs, 889 * but we need to assign each kind of message to a different bit so that 890 * one index can hold multiple types.) 891 */ 892 enum H5O_SHMESG_NONE_FLAG = 0x0000; /* No shared messages */ 893 enum H5O_SHMESG_SDSPACE_FLAG = (cast(uint)1 << 0x0001); /* Simple Dataspace Message. */ 894 enum H5O_SHMESG_DTYPE_FLAG = (cast(uint)1 << 0x0003); /* Datatype Message. */ 895 enum H5O_SHMESG_FILL_FLAG = (cast(uint)1 << 0x0005); /* Fill Value Message. */ 896 enum H5O_SHMESG_PLINE_FLAG = (cast(uint)1 << 0x000b); /* Filter pipeline message. */ 897 enum H5O_SHMESG_ATTR_FLAG = (cast(uint)1 << 0x000c); /* Attribute Message. */ 898 enum H5O_SHMESG_ALL_FLAG = (H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG | H5O_SHMESG_FILL_FLAG | H5O_SHMESG_PLINE_FLAG | H5O_SHMESG_ATTR_FLAG); 899 900 /* Object header status flag definitions */ 901 enum H5O_HDR_CHUNK0_SIZE = 0x03; /* 2-bit field indicating # of bytes to store the size of chunk 0's data */ 902 enum H5O_HDR_ATTR_CRT_ORDER_TRACKED = 0x04; /* Attribute creation order is tracked */ 903 enum H5O_HDR_ATTR_CRT_ORDER_INDEXED = 0x08; /* Attribute creation order has index */ 904 enum H5O_HDR_ATTR_STORE_PHASE_CHANGE = 0x10; /* Non-default attribute storage phase change values stored */ 905 enum H5O_HDR_STORE_TIMES = 0x20; /* Store access, modification, change & birth times for object */ 906 enum H5O_HDR_ALL_FLAGS = (H5O_HDR_CHUNK0_SIZE | H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_ATTR_STORE_PHASE_CHANGE | H5O_HDR_STORE_TIMES); 907 908 /* Maximum shared message values. Number of indexes is 8 to allow room to add 909 * new types of messages. 910 */ 911 enum H5O_SHMESG_MAX_NINDEXES = 8; 912 enum H5O_SHMESG_MAX_LIST_SIZE = 5000; 913 914 /*******************/ 915 /* Public Typedefs */ 916 /*******************/ 917 918 /* Types of objects in file */ 919 enum H5OType { 920 Unknown = -1, /* Unknown object type */ 921 Group, /* Object is a group */ 922 Dataset, /* Object is a dataset */ 923 NamedDataType, /* Object is a named data type */ 924 TypeNTypes /* Number of different object types (must be last!) */ 925 } 926 927 /* Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */ 928 align(1) 929 { 930 struct H5O_hdr_info_t { 931 uint _version; /* Version number of header format in file */ 932 uint nmesgs; /* Number of object header messages */ 933 uint nchunks; /* Number of object header chunks */ 934 uint flags; /* Object header status flags */ 935 struct space { 936 hsize_t total; /* Total space for storing object header in file */ 937 hsize_t meta; /* Space within header for object header metadata information */ 938 hsize_t mesg; /* Space within header for actual message information */ 939 hsize_t free; /* Free space within object header */ 940 } 941 struct mesg { 942 uint64_t present; /* Flags to indicate presence of message type in header */ 943 uint64_t _shared; /* Flags to indicate message type is shared in header */ 944 } 945 } 946 } 947 948 /* Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */ 949 struct H5O_info_t { 950 ulong fileno; /* File number that object is located in */ 951 haddr_t addr; /* Object address in file */ 952 H5OType type; /* Basic object type (group, dataset, etc.) */ 953 uint rc; /* Reference count of object */ 954 time_t atime; /* Access time */ 955 time_t mtime; /* Modification time */ 956 time_t ctime; /* Change time */ 957 time_t btime; /* Birth time */ 958 hsize_t num_attrs; /* # of attributes attached to object */ 959 H5O_hdr_info_t hdr; /* Object header information */ 960 /* Extra metadata storage for obj & attributes */ 961 struct meta_size { 962 H5_ih_info_t obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ 963 H5_ih_info_t attr; /* v2 B-tree & heap for attributes */ 964 } 965 } 966 } 967 968 extern(C) 969 { 970 /* Typedef for message creation indexes */ 971 alias H5O_msg_crt_idx_t = uint32_t; 972 973 /* Prototype for H5Ovisit/H5Ovisit_by_name() operator */ 974 alias H5O_iterate_t = herr_t function(hid_t obj, const char *name, const H5O_info_t *info, void *op_data); 975 } 976 enum H5O_mcdt_search_ret_t { 977 H5O_MCDT_SEARCH_ERROR = -1, /* Abort H5Ocopy */ 978 H5O_MCDT_SEARCH_CONT, /* Continue the global search of all committed datatypes in the destination file */ 979 H5O_MCDT_SEARCH_STOP /* Stop the search, but continue copying. The committed datatype will be copied but not merged. */ 980 }; 981 982 /* Callback to invoke when completing the search for a matching committed datatype from the committed dtype list */ 983 extern(C) 984 { 985 alias H5O_mcdt_search_cb_t = H5O_mcdt_search_ret_t function(void *op_data); 986 } 987 /********************/ 988 /* Public Variables */ 989 /********************/ 990 991 version(Posix) 992 { 993 extern(C) 994 { 995 // Public Prototypes 996 hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id); 997 hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr); 998 hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id); 999 htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id); 1000 herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo); 1001 herr_t H5Oget_info_by_name(hid_t loc_id, const (char *)name, H5O_info_t *oinfo, hid_t lapl_id); 1002 herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id); 1003 herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id); 1004 herr_t H5Oincr_refcount(hid_t object_id); 1005 herr_t H5Odecr_refcount(hid_t object_id); 1006 herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); 1007 herr_t H5Oset_comment(hid_t obj_id, const char *comment); 1008 herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id); 1009 ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize); 1010 ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, hid_t lapl_id); 1011 herr_t H5Ovisit(hid_t obj_id, H5Index idx_type, H5IterOrder order, H5O_iterate_t op, void *op_data); 1012 herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, H5O_iterate_t op, void *op_data, hid_t lapl_id); 1013 herr_t H5Oclose(hid_t object_id); 1014 } 1015 } 1016 extern(C) 1017 { 1018 1019 /*****************/ 1020 /* Public Macros */ 1021 /*****************/ 1022 1023 /* 1024 * The library's property list classes 1025 */ 1026 alias H5P_ROOT = H5P_CLS_ROOT_g; 1027 alias H5P_OBJECT_CREATE = H5P_CLS_OBJECT_CREATE_g; 1028 alias H5P_FILE_CREATE = H5P_CLS_FILE_CREATE_g; 1029 alias H5P_FILE_ACCESS = H5P_CLS_FILE_ACCESS_g; 1030 alias H5P_DATASET_CREATE = H5P_CLS_DATASET_CREATE_g; 1031 alias H5P_DATASET_ACCESS = H5P_CLS_DATASET_ACCESS_g; 1032 alias H5P_DATASET_XFER = H5P_CLS_DATASET_XFER_g; 1033 alias H5P_FILE_MOUNT = H5P_CLS_FILE_MOUNT_g; 1034 alias H5P_GROUP_CREATE = H5P_CLS_GROUP_CREATE_g; 1035 alias H5P_GROUP_ACCESS = H5P_CLS_GROUP_ACCESS_g; 1036 alias H5P_DATATYPE_CREATE = H5P_CLS_DATATYPE_CREATE_g; 1037 alias H5P_DATATYPE_ACCESS = H5P_CLS_DATATYPE_ACCESS_g; 1038 alias H5P_STRING_CREATE = H5P_CLS_STRING_CREATE_g; 1039 alias H5P_ATTRIBUTE_CREATE = H5P_CLS_ATTRIBUTE_CREATE_g; 1040 alias H5P_OBJECT_COPY = H5P_CLS_OBJECT_COPY_g; 1041 alias H5P_LINK_CREATE = H5P_CLS_LINK_CREATE_g; 1042 alias H5P_LINK_ACCESS = H5P_CLS_LINK_ACCESS_g; 1043 1044 /* 1045 * The library's default property lists 1046 */ 1047 alias H5P_FILE_CREATE_DEFAULT = H5P_LST_FILE_CREATE_g; 1048 alias H5P_FILE_ACCESS_DEFAULT = H5P_LST_FILE_ACCESS_g; 1049 alias H5P_DATASET_CREATE_DEFAULT = H5P_LST_DATASET_CREATE_g; 1050 alias H5P_DATASET_ACCESS_DEFAULT = H5P_LST_DATASET_ACCESS_g; 1051 alias H5P_DATASET_XFER_DEFAULT = H5P_LST_DATASET_XFER_g; 1052 alias H5P_FILE_MOUNT_DEFAULT = H5P_LST_FILE_MOUNT_g; 1053 alias H5P_GROUP_CREATE_DEFAULT = H5P_LST_GROUP_CREATE_g; 1054 alias H5P_GROUP_ACCESS_DEFAULT = H5P_LST_GROUP_ACCESS_g; 1055 alias H5P_DATATYPE_CREATE_DEFAULT = H5P_LST_DATATYPE_CREATE_g; 1056 alias H5P_DATATYPE_ACCESS_DEFAULT = H5P_LST_DATATYPE_ACCESS_g; 1057 alias H5P_ATTRIBUTE_CREATE_DEFAULT = H5P_LST_ATTRIBUTE_CREATE_g; 1058 alias H5P_OBJECT_COPY_DEFAULT = H5P_LST_OBJECT_COPY_g; 1059 alias H5P_LINK_CREATE_DEFAULT = H5P_LST_LINK_CREATE_g; 1060 alias H5P_LINK_ACCESS_DEFAULT = H5P_LST_LINK_ACCESS_g; 1061 1062 /* Common creation order flags (for links in groups and attributes on objects) */ 1063 enum H5P_CRT_ORDER_TRACKED = 0x0001; 1064 enum H5P_CRT_ORDER_INDEXED = 0x0002; 1065 1066 /*******************/ 1067 /* Public Typedefs */ 1068 /*******************/ 1069 1070 /* Define property list class callback function pointer types */ 1071 alias H5P_cls_create_func_t = herr_t function(hid_t prop_id, void *create_data); 1072 alias H5P_cls_copy_func_t = herr_t function(hid_t new_prop_id, hid_t old_prop_id, void *copy_data); 1073 alias H5P_cls_close_func_t = herr_t function(hid_t prop_id, void *close_data); 1074 1075 /* Define property list callback function pointer types */ 1076 alias H5P_prp_cb1_t = herr_t function(const char *name, size_t size, void *value); 1077 alias H5P_prp_cb2_t = herr_t function(hid_t prop_id, const char *name, size_t size, void *value); 1078 alias H5P_prp_create_func_t = H5P_prp_cb1_t; 1079 alias H5P_prp_set_func_t = H5P_prp_cb2_t; 1080 alias H5P_prp_get_func_t = H5P_prp_cb2_t; 1081 alias H5P_prp_delete_func_t = H5P_prp_cb2_t; 1082 alias H5P_prp_copy_func_t = H5P_prp_cb1_t; 1083 alias H5P_prp_compare_func_t = int function(const void *value1, const void *value2, size_t size); 1084 alias H5P_prp_close_func_t = H5P_prp_cb1_t; 1085 1086 /* Define property list iteration function type */ 1087 alias H5P_iterate_t = herr_t function(hid_t id, const char *name, void *iter_data); 1088 } 1089 1090 /* Actual IO mode property */ 1091 enum H5D_mpio_actual_chunk_opt_mode_t { 1092 /* The default value, H5D_MPIO_NO_CHUNK_OPTIMIZATION, is used for all I/O 1093 * operations that do not use chunk optimizations, including non-collective 1094 * I/O and contiguous collective I/O. 1095 */ 1096 H5D_MPIO_NO_CHUNK_OPTIMIZATION = 0, 1097 H5D_MPIO_LINK_CHUNK, 1098 H5D_MPIO_MULTI_CHUNK 1099 } 1100 1101 enum H5D_mpio_actual_io_mode_t { 1102 /* The following four values are conveniently defined as a bit field so that 1103 * we can switch from the default to indpendent or collective and then to 1104 * mixed without having to check the original value. 1105 * 1106 * NO_COLLECTIVE means that either collective I/O wasn't requested or that 1107 * no I/O took place. 1108 * 1109 * CHUNK_INDEPENDENT means that collective I/O was requested, but the 1110 * chunk optimization scheme chose independent I/O for each chunk. 1111 */ 1112 H5D_MPIO_NO_COLLECTIVE = 0x0, 1113 H5D_MPIO_CHUNK_INDEPENDENT = 0x1, 1114 H5D_MPIO_CHUNK_COLLECTIVE = 0x2, 1115 H5D_MPIO_CHUNK_MIXED = 0x1 | 0x2, 1116 1117 /* The contiguous case is separate from the bit field. */ 1118 H5D_MPIO_CONTIGUOUS_COLLECTIVE = 0x4 1119 } 1120 1121 /* Broken collective IO property */ 1122 enum H5D_mpio_no_collective_cause_t { 1123 H5D_MPIO_COLLECTIVE = 0x00, 1124 H5D_MPIO_SET_INDEPENDENT = 0x01, 1125 H5D_MPIO_DATATYPE_CONVERSION = 0x02, 1126 H5D_MPIO_DATA_TRANSFORMS = 0x04, 1127 H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED = 0x08, 1128 H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES = 0x10, 1129 H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET = 0x20, 1130 H5D_MPIO_FILTERS = 0x40 1131 } 1132 1133 /********************/ 1134 /* Public Variables */ 1135 /********************/ 1136 1137 /* Property list class IDs */ 1138 /* (Internal to library, do not use! Use macros above) */ 1139 extern(C) 1140 { 1141 extern __gshared hid_t H5P_CLS_ROOT_g; 1142 extern __gshared hid_t H5P_CLS_OBJECT_CREATE_g; 1143 extern __gshared hid_t H5P_CLS_FILE_CREATE_g; 1144 extern __gshared hid_t H5P_CLS_FILE_ACCESS_g; 1145 extern __gshared hid_t H5P_CLS_DATASET_CREATE_g; 1146 extern __gshared hid_t H5P_CLS_DATASET_ACCESS_g; 1147 extern __gshared hid_t H5P_CLS_DATASET_XFER_g; 1148 extern __gshared hid_t H5P_CLS_FILE_MOUNT_g; 1149 extern __gshared hid_t H5P_CLS_GROUP_CREATE_g; 1150 extern __gshared hid_t H5P_CLS_GROUP_ACCESS_g; 1151 extern __gshared hid_t H5P_CLS_DATATYPE_CREATE_g; 1152 extern __gshared hid_t H5P_CLS_DATATYPE_ACCESS_g; 1153 extern __gshared hid_t H5P_CLS_STRING_CREATE_g; 1154 extern __gshared hid_t H5P_CLS_ATTRIBUTE_CREATE_g; 1155 extern __gshared hid_t H5P_CLS_OBJECT_COPY_g; 1156 extern __gshared hid_t H5P_CLS_LINK_CREATE_g; 1157 extern __gshared hid_t H5P_CLS_LINK_ACCESS_g; 1158 1159 /* Default roperty list IDs */ 1160 /* (Internal to library, do not use! Use macros above) */ 1161 extern __gshared hid_t H5P_LST_FILE_CREATE_g; 1162 extern __gshared hid_t H5P_LST_FILE_ACCESS_g; 1163 extern __gshared hid_t H5P_LST_DATASET_CREATE_g; 1164 extern __gshared hid_t H5P_LST_DATASET_ACCESS_g; 1165 extern __gshared hid_t H5P_LST_DATASET_XFER_g; 1166 extern __gshared hid_t H5P_LST_FILE_MOUNT_g; 1167 extern __gshared hid_t H5P_LST_GROUP_CREATE_g; 1168 extern __gshared hid_t H5P_LST_GROUP_ACCESS_g; 1169 extern __gshared hid_t H5P_LST_DATATYPE_CREATE_g; 1170 extern __gshared hid_t H5P_LST_DATATYPE_ACCESS_g; 1171 extern __gshared hid_t H5P_LST_ATTRIBUTE_CREATE_g; 1172 extern __gshared hid_t H5P_LST_OBJECT_COPY_g; 1173 extern __gshared hid_t H5P_LST_LINK_CREATE_g; 1174 extern __gshared hid_t H5P_LST_LINK_ACCESS_g; 1175 } 1176 /*********************/ 1177 /* Public Prototypes */ 1178 /*********************/ 1179 1180 version(Posix) { 1181 extern(C) 1182 { 1183 /* Generic property list routines */ 1184 hid_t H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, 1185 H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); 1186 char *H5Pget_class_name(hid_t pclass_id); 1187 hid_t H5Pcreate(hid_t cls_id); 1188 herr_t H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, 1189 H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, 1190 H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); 1191 herr_t H5Pinsert2(hid_t plist_id, const char *name, size_t size, 1192 void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, 1193 H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, 1194 H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); 1195 herr_t H5Pset(hid_t plist_id, const char *name, void *value); 1196 htri_t H5Pexist(hid_t plist_id, const char *name); 1197 herr_t H5Pget_size(hid_t id, const char *name, size_t *size); 1198 herr_t H5Pget_nprops(hid_t id, size_t *nprops); 1199 hid_t H5Pget_class(hid_t plist_id); 1200 hid_t H5Pget_class_parent(hid_t pclass_id); 1201 herr_t H5Pget(hid_t plist_id, const char *name, void * value); 1202 htri_t H5Pequal(hid_t id1, hid_t id2); 1203 htri_t H5Pisa_class(hid_t plist_id, hid_t pclass_id); 1204 int H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, 1205 void *iter_data); 1206 herr_t H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name); 1207 herr_t H5Premove(hid_t plist_id, const char *name); 1208 herr_t H5Punregister(hid_t pclass_id, const char *name); 1209 herr_t H5Pclose_class(hid_t plist_id); 1210 herr_t H5Pclose(hid_t plist_id); 1211 hid_t H5Pcopy(hid_t plist_id); 1212 1213 /* Object creation property list (OCPL) routines */ 1214 herr_t H5Pset_attr_phase_change(hid_t plist_id, uint max_compact, uint min_dense); 1215 herr_t H5Pget_attr_phase_change(hid_t plist_id, uint *max_compact, uint *min_dense); 1216 herr_t H5Pset_attr_creation_order(hid_t plist_id, uint crt_order_flags); 1217 herr_t H5Pget_attr_creation_order(hid_t plist_id, uint *crt_order_flags); 1218 herr_t H5Pset_obj_track_times(hid_t plist_id, hbool_t track_times); 1219 herr_t H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times); 1220 herr_t H5Pmodify_filter(hid_t plist_id, H5ZFilter filter, 1221 int flags, size_t cd_nelmts, 1222 const int* cd_values); 1223 herr_t H5Pset_filter(hid_t plist_id, H5ZFilter filter, int flags, size_t cd_nelmts, const int* c_values); 1224 int H5Pget_nfilters(hid_t plist_id); 1225 H5ZFilter H5Pget_filter2(hid_t plist_id, uint filter, 1226 int *flags/*out*/, 1227 size_t *cd_nelmts/*out*/, 1228 uint* cd_values/*out*/, 1229 size_t namelen, char* name, 1230 uint *filter_config /*out*/); 1231 herr_t H5Pget_filter_by_id2(hid_t plist_id, H5ZFilter id, 1232 uint *flags/*out*/, size_t *cd_nelmts/*out*/, 1233 int* cd_values/*out*/, size_t namelen, char* name/*out*/, 1234 int *filter_config/*out*/); 1235 htri_t H5Pall_filters_avail(hid_t plist_id); 1236 herr_t H5Premove_filter(hid_t plist_id, H5ZFilter filter); 1237 herr_t H5Pset_deflate(hid_t plist_id, int aggression); 1238 herr_t H5Pset_fletcher32(hid_t plist_id); 1239 1240 /* File creation property list (FCPL) routines */ 1241 herr_t H5Pget_version(hid_t plist_id, uint *boot/*out*/, 1242 uint *freelist/*out*/, uint *stab/*out*/, 1243 uint *shhdr/*out*/); 1244 herr_t H5Pset_userblock(hid_t plist_id, hsize_t size); 1245 herr_t H5Pget_userblock(hid_t plist_id, hsize_t *size); 1246 herr_t H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, 1247 size_t sizeof_size); 1248 herr_t H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr/*out*/, 1249 size_t *sizeof_size/*out*/); 1250 herr_t H5Pset_sym_k(hid_t plist_id, uint ik, uint lk); 1251 herr_t H5Pget_sym_k(hid_t plist_id, uint *ik/*out*/, uint *lk/*out*/); 1252 herr_t H5Pset_istore_k(hid_t plist_id, uint ik); 1253 herr_t H5Pget_istore_k(hid_t plist_id, uint *ik/*out*/); 1254 herr_t H5Pset_shared_mesg_nindexes(hid_t plist_id, uint nindexes); 1255 herr_t H5Pget_shared_mesg_nindexes(hid_t plist_id, uint *nindexes); 1256 herr_t H5Pset_shared_mesg_index(hid_t plist_id, uint index_num, uint mesg_type_flags, uint min_mesg_size); 1257 herr_t H5Pget_shared_mesg_index(hid_t plist_id, uint index_num, uint *mesg_type_flags, uint *min_mesg_size); 1258 herr_t H5Pset_shared_mesg_phase_change(hid_t plist_id, uint max_list, uint min_btree); 1259 herr_t H5Pget_shared_mesg_phase_change(hid_t plist_id, uint *max_list, uint *min_btree); 1260 1261 /* File access property list (FAPL) routines */ 1262 herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold, 1263 hsize_t alignment); 1264 herr_t H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/, 1265 hsize_t *alignment/*out*/); 1266 herr_t H5Pset_driver(hid_t plist_id, hid_t driver_id, 1267 const void *driver_info); 1268 hid_t H5Pget_driver(hid_t plist_id); 1269 void *H5Pget_driver_info(hid_t plist_id); 1270 herr_t H5Pset_family_offset(hid_t fapl_id, hsize_t offset); 1271 herr_t H5Pget_family_offset(hid_t fapl_id, hsize_t *offset); 1272 herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts, 1273 size_t rdcc_nslots, size_t rdcc_nbytes, 1274 double rdcc_w0); 1275 herr_t H5Pget_cache(hid_t plist_id, 1276 int *mdc_nelmts, /* out */ 1277 size_t *rdcc_nslots/*out*/, 1278 size_t *rdcc_nbytes/*out*/, double *rdcc_w0); 1279 herr_t H5Pset_gc_references(hid_t fapl_id, uint gc_ref); 1280 herr_t H5Pget_gc_references(hid_t fapl_id, uint *gc_ref/*out*/); 1281 herr_t H5Pset_fclose_degree(hid_t fapl_id, H5F_close_degree_t degree); 1282 herr_t H5Pget_fclose_degree(hid_t fapl_id, H5F_close_degree_t *degree); 1283 herr_t H5Pset_meta_block_size(hid_t fapl_id, hsize_t size); 1284 herr_t H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size/*out*/); 1285 herr_t H5Pset_sieve_buf_size(hid_t fapl_id, size_t size); 1286 herr_t H5Pget_sieve_buf_size(hid_t fapl_id, size_t *size/*out*/); 1287 herr_t H5Pset_small_data_block_size(hid_t fapl_id, hsize_t size); 1288 herr_t H5Pget_small_data_block_size(hid_t fapl_id, hsize_t *size/*out*/); 1289 herr_t H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, 1290 H5F_libver_t high); 1291 herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, 1292 H5F_libver_t *high); 1293 herr_t H5Pset_elink_file_cache_size(hid_t plist_id, uint efc_size); 1294 herr_t H5Pget_elink_file_cache_size(hid_t plist_id, uint *efc_size); 1295 herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); 1296 herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); 1297 version(h5parallel) herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); 1298 version(h5parallel) herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); 1299 herr_t H5Pset_layout(hid_t plist_id, H5DLayout layout); 1300 H5DLayout H5Pget_layout(hid_t plist_id); 1301 herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t *dim/*ndims*/); 1302 int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t *dim/*out*/); 1303 herr_t H5Pset_external(hid_t plist_id, const char *name, off_t offset, 1304 hsize_t size); 1305 int H5Pget_external_count(hid_t plist_id); 1306 herr_t H5Pget_external(hid_t plist_id, uint idx, size_t name_size, 1307 char *name/*out*/, off_t *offset/*out*/, 1308 hsize_t *size/*out*/); 1309 herr_t H5Pset_szip(hid_t plist_id, uint options_mask, uint pixels_per_block); 1310 herr_t H5Pset_shuffle(hid_t plist_id); 1311 herr_t H5Pset_nbit(hid_t plist_id); 1312 herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_factor); 1313 herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value); 1314 herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/); 1315 herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); 1316 herr_t H5Pset_alloc_time(hid_t plist_id, H5DAllocTime alloc_time); 1317 herr_t H5Pget_alloc_time(hid_t plist_id, H5DAllocTime *alloc_time/*out*/); 1318 herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); 1319 herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/); 1320 1321 /* Dataset access property list (DAPL) routines */ 1322 herr_t H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, 1323 size_t rdcc_nbytes, double rdcc_w0); 1324 herr_t H5Pget_chunk_cache(hid_t dapl_id, 1325 size_t *rdcc_nslots/*out*/, 1326 size_t *rdcc_nbytes/*out*/, 1327 double *rdcc_w0/*out*/); 1328 1329 /* Dataset xfer property list (DXPL) routines */ 1330 herr_t H5Pset_data_transform(hid_t plist_id, const char* expression); 1331 ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t size); 1332 herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, 1333 void *bkg); 1334 size_t H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, 1335 void **bkg/*out*/); 1336 herr_t H5Pset_preserve(hid_t plist_id, hbool_t status); 1337 int H5Pget_preserve(hid_t plist_id); 1338 herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check); 1339 H5Z_EDC_t H5Pget_edc_check(hid_t plist_id); 1340 herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, 1341 void* op_data); 1342 herr_t H5Pset_btree_ratios(hid_t plist_id, double left, double middle, 1343 double right); 1344 herr_t H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, 1345 double *middle/*out*/, 1346 double *right/*out*/); 1347 herr_t H5Pset_hyper_vector_size(hid_t fapl_id, size_t size); 1348 herr_t H5Pget_hyper_vector_size(hid_t fapl_id, size_t *size/*out*/); 1349 herr_t H5Pset_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t op, void* operate_data); 1350 herr_t H5Pget_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t *op, void** operate_data); 1351 version(h5parallel) 1352 { 1353 herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode); 1354 herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode); 1355 herr_t H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, uint32_t *global_no_collective_cause); 1356 } 1357 1358 /* Link creation property list (LCPL) routines */ 1359 herr_t H5Pset_create_intermediate_group(hid_t plist_id, uint crt_intmd); 1360 herr_t H5Pget_create_intermediate_group(hid_t plist_id, uint *crt_intmd /*out*/); 1361 1362 /* Group creation property list (GCPL) routines */ 1363 herr_t H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint); 1364 herr_t H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/); 1365 herr_t H5Pset_link_phase_change(hid_t plist_id, uint max_compact, uint min_dense); 1366 herr_t H5Pget_link_phase_change(hid_t plist_id, uint *max_compact /*out*/, uint *min_dense /*out*/); 1367 herr_t H5Pset_est_link_info(hid_t plist_id, uint est_num_entries, uint est_name_len); 1368 herr_t H5Pget_est_link_info(hid_t plist_id, uint *est_num_entries /* out */, uint *est_name_len /* out */); 1369 herr_t H5Pset_link_creation_order(hid_t plist_id, uint crt_order_flags); 1370 herr_t H5Pget_link_creation_order(hid_t plist_id, uint *crt_order_flags /* out */); 1371 1372 /* String creation property list (STRCPL) routines */ 1373 herr_t H5Pset_char_encoding(hid_t plist_id, H5TCset encoding); 1374 herr_t H5Pget_char_encoding(hid_t plist_id, H5TCset *encoding /*out*/); 1375 1376 /* Link access property list (LAPL) routines */ 1377 herr_t H5Pset_nlinks(hid_t plist_id, size_t nlinks); 1378 herr_t H5Pget_nlinks(hid_t plist_id, size_t *nlinks); 1379 herr_t H5Pset_elink_prefix(hid_t plist_id, const char *prefix); 1380 ssize_t H5Pget_elink_prefix(hid_t plist_id, char *prefix, size_t size); 1381 hid_t H5Pget_elink_fapl(hid_t lapl_id); 1382 herr_t H5Pset_elink_fapl(hid_t lapl_id, hid_t fapl_id); 1383 herr_t H5Pset_elink_acc_flags(hid_t lapl_id, uint flags); 1384 herr_t H5Pget_elink_acc_flags(hid_t lapl_id, uint *flags); 1385 /++ 1386 herr_t H5Pset_elink_cb(hid_t lapl_id, H5L_elink_traverse_t func, void *op_data); 1387 herr_t H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data); 1388 +/ 1389 1390 /* Object copy property list (OCPYPL) routines */ 1391 herr_t H5Pset_copy_object(hid_t plist_id, uint crt_intmd); 1392 herr_t H5Pget_copy_object(hid_t plist_id, uint *crt_intmd /*out*/); 1393 herr_t H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path); 1394 herr_t H5Pfree_merge_committed_dtype_paths(hid_t plist_id); 1395 /++ 1396 herr_t H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data); 1397 herr_t H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data); 1398 +/ 1399 1400 } 1401 } 1402 1403 enum H5RType 1404 { 1405 BadType=-1, /*invalid Reference Type */ 1406 ObjectRef, /*Object reference */ 1407 DatasetRegion, /*Dataset Region Reference */ 1408 MaxType /*highest type (Invalid as true type) */ 1409 } 1410 1411 /* Note! Be careful with the sizes of the references because they should really 1412 * depend on the run-time values in the file. Unfortunately, the arrays need 1413 * to be defined at compile-time, so we have to go with the worst case sizes for 1414 * them. -QAK 1415 */ 1416 enum H5R_OBJ_REF_BUF_SIZE =haddr_t.sizeof; 1417 /* Object reference structure for user's code */ 1418 //alias hobj_ref_t haddr_t ; /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) */ 1419 1420 enum H5R_DSET_REG_REF_BUF_SIZE =haddr_t.sizeof+4; 1421 /* 4 is used instead of sizeof(int) to permit portability between 1422 the Crays and other machines (the heap ID is always encoded as an int32 anyway) 1423 */ 1424 /* Dataset Region reference structure for user's code */ 1425 alias hdset_reg_ref_t = ubyte[H5R_DSET_REG_REF_BUF_SIZE];/* Buffer to store heap ID and index */ 1426 /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) plus an int */ 1427 1428 extern(C) 1429 { 1430 herr_t H5Rcreate(void *_ref, hid_t loc_id, const char *name, H5RType reftype, hid_t space_id); 1431 hid_t H5Rdereference(hid_t dataset, H5RType ref_type, const void *_ref); 1432 hid_t H5Rget_region(hid_t dataset, H5RType ref_type, const void *_ref); 1433 herr_t H5Rget_obj_type2(hid_t id, H5RType ref_type, const void *_ref, H5OType *obj_type); 1434 ssize_t H5Rget_name(hid_t loc_id, H5RType ref_type, const void *_ref, char *name/*out*/, size_t size); 1435 } 1436 1437 1438 /* Define atomic datatypes */ 1439 enum H5S_ALL = 0; 1440 enum H5S_UNLIMITED = (cast(hsize_t)cast(hssize_t)(-1)); 1441 1442 /* Define user-level maximum number of dimensions */ 1443 enum H5S_MAX_RANK = 32; 1444 1445 /* Different types of dataspaces */ 1446 enum H5SClass { 1447 None = -1, /*error */ 1448 Scalar = 0, /*scalar variable */ 1449 Simple = 1, /*simple data space */ 1450 Null = 2 /*null data space */ 1451 } 1452 1453 /* Different ways of combining selections */ 1454 enum H5SSeloper { 1455 Noop = -1, /* error */ 1456 Set = 0, /* Select "set" operation */ 1457 Or, 1458 And, 1459 Xor, 1460 NotB, 1461 NotA, 1462 Append, 1463 Prepend, 1464 Invalid, 1465 } 1466 1467 enum { 1468 H5S_SELECT_NOOP = -1, /* error */ 1469 H5S_SELECT_SET = 0, /* Select "set" operation */ 1470 H5S_SELECT_OR, /* Binary "or" operation for hyperslabs 1471 * (add new selection to existing selection) 1472 * Original region: AAAAAAAAAA 1473 * New region: BBBBBBBBBB 1474 * A or B: CCCCCCCCCCCCCCCC 1475 */ 1476 H5S_SELECT_AND, /* Binary "and" operation for hyperslabs 1477 * (only leave overlapped regions in selection) 1478 * Original region: AAAAAAAAAA 1479 * New region: BBBBBBBBBB 1480 * A and B: CCCC 1481 */ 1482 H5S_SELECT_XOR, /* Binary "xor" operation for hyperslabs 1483 * (only leave non-overlapped regions in selection) 1484 * Original region: AAAAAAAAAA 1485 * New region: BBBBBBBBBB 1486 * A xor B: CCCCCC CCCCCC 1487 */ 1488 H5S_SELECT_NOTB, /* Binary "not" operation for hyperslabs 1489 * (only leave non-overlapped regions in original selection) 1490 * Original region: AAAAAAAAAA 1491 * New region: BBBBBBBBBB 1492 * A not B: CCCCCC 1493 */ 1494 H5S_SELECT_NOTA, /* Binary "not" operation for hyperslabs 1495 * (only leave non-overlapped regions in new selection) 1496 * Original region: AAAAAAAAAA 1497 * New region: BBBBBBBBBB 1498 * B not A: CCCCCC 1499 */ 1500 H5S_SELECT_APPEND, /* Append elements to end of point selection */ 1501 H5S_SELECT_PREPEND, /* Prepend elements to beginning of point selection */ 1502 H5S_SELECT_INVALID /* Invalid upper bound on selection operations */ 1503 } 1504 1505 /* Enumerated type for the type of selection */ 1506 enum H5S_sel_type { 1507 H5S_SEL_ERROR = -1, /* Error */ 1508 H5S_SEL_NONE = 0, /* Nothing selected */ 1509 H5S_SEL_POINTS = 1, /* Sequence of points selected */ 1510 H5S_SEL_HYPERSLABS = 2, /* "New-style" hyperslab selection defined */ 1511 H5S_SEL_ALL = 3, /* Entire extent selected */ 1512 H5S_SEL_N /*THIS MUST BE LAST */ 1513 } 1514 1515 1516 version(Posix) { 1517 extern(C) 1518 { 1519 /* Functions in H5S.c */ 1520 hid_t H5Screate(H5SClass type); 1521 hid_t H5Screate_simple(int rank, const hsize_t *dims, 1522 const hsize_t *maxdims); 1523 herr_t H5Sset_extent_simple(hid_t space_id, int rank, 1524 const hsize_t *dims, 1525 const hsize_t *max); 1526 hid_t H5Scopy(hid_t space_id); 1527 herr_t H5Sclose(hid_t space_id); 1528 herr_t H5Sencode(hid_t obj_id, void *buf, size_t *nalloc); 1529 hid_t H5Sdecode(const void *buf); 1530 hssize_t H5Sget_simple_extent_npoints(hid_t space_id); 1531 int H5Sget_simple_extent_ndims(hid_t space_id); 1532 int H5Sget_simple_extent_dims(hid_t space_id, hsize_t *dims, 1533 hsize_t *maxdims); 1534 htri_t H5Sis_simple(hid_t space_id); 1535 hssize_t H5Sget_select_npoints(hid_t spaceid); 1536 herr_t H5Sselect_hyperslab(hid_t space_id, H5SSeloper op, 1537 const hsize_t *start, 1538 const hsize_t *_stride, 1539 const hsize_t *count, 1540 const hsize_t *_block); 1541 hid_t H5Scombine_hyperslab(hid_t space_id, H5SSeloper op, 1542 const hsize_t *start, 1543 const hsize_t *_stride, 1544 const hsize_t *count, 1545 const hsize_t *_block); 1546 herr_t H5Sselect_select(hid_t space1_id, H5SSeloper op, 1547 hid_t space2_id); 1548 hid_t H5Scombine_select(hid_t space1_id, H5SSeloper op, 1549 hid_t space2_id); 1550 herr_t H5Sselect_elements(hid_t space_id, H5SSeloper op, 1551 size_t num_elem, const hsize_t *coord); 1552 H5SClass H5Sget_simple_extent_type(hid_t space_id); 1553 herr_t H5Sset_extent_none(hid_t space_id); 1554 herr_t H5Sextent_copy(hid_t dst_id,hid_t src_id); 1555 htri_t H5Sextent_equal(hid_t sid1, hid_t sid2); 1556 herr_t H5Sselect_all(hid_t spaceid); 1557 herr_t H5Sselect_none(hid_t spaceid); 1558 herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset); 1559 htri_t H5Sselect_valid(hid_t spaceid); 1560 hssize_t H5Sget_select_hyper_nblocks(hid_t spaceid); 1561 hssize_t H5Sget_select_elem_npoints(hid_t spaceid); 1562 herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, 1563 hsize_t numblocks, hsize_t *buf); 1564 herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, 1565 hsize_t numpoints, hsize_t *buf); 1566 herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t *start, 1567 hsize_t *end); 1568 H5S_sel_type H5Sget_select_type(hid_t spaceid); 1569 } 1570 } 1571 1572 /* These are the various classes of datatypes */ 1573 /* If this goes over 16 types (0-15), the file format will need to change) */ 1574 enum H5TClass { 1575 None = -1, /*error */ 1576 Integer = 0, /*integer types */ 1577 Float = 1, /*floating-point types */ 1578 Time = 2, /*date and time types */ 1579 String = 3, /*character string types */ 1580 Bitfield = 4, /*bit field types */ 1581 Opaque = 5, /*opaque types */ 1582 Compound = 6, /*compound types */ 1583 Reference = 7, /*reference types */ 1584 Enum = 8, /*enumeration types */ 1585 Vlen = 9, /*Variable-Length types */ 1586 Array = 10, /*Array types */ 1587 Nclasses /*this must be last */ 1588 } 1589 1590 /* Byte orders */ 1591 enum H5TByteOrder { 1592 Error = -1, /*error */ 1593 LE = 0, /*little endian */ 1594 BE = 1, /*bit endian */ 1595 Vax = 2, /*VAX mixed endian */ 1596 Mixed = 3, /*Compound type with mixed member orders */ 1597 None = 4 /*no particular order (strings, bits,..) */ 1598 /*H5T_ORDER_NONE must be last */ 1599 } 1600 1601 /* Types of integer sign schemes */ 1602 enum H5T_sign_t { 1603 H5T_SGN_ERROR = -1, /*error */ 1604 H5T_SGN_NONE = 0, /*this is an unsigned type */ 1605 H5T_SGN_2 = 1, /*two's complement */ 1606 1607 H5T_NSGN = 2 /*this must be last! */ 1608 } 1609 1610 /* Floating-point normalization schemes */ 1611 enum H5T_norm_t { 1612 H5T_NORM_ERROR = -1, /*error */ 1613 H5T_NORM_IMPLIED = 0, /*msb of mantissa isn't stored, always 1 */ 1614 H5T_NORM_MSBSET = 1, /*msb of mantissa is always 1 */ 1615 H5T_NORM_NONE = 2 /*not normalized */ 1616 /*H5T_NORM_NONE must be last */ 1617 } 1618 1619 /* 1620 * Character set to use for text strings. Do not change these values since 1621 * they appear in HDF5 files! 1622 */ 1623 enum H5TCset { 1624 Error = -1, /*error */ 1625 ASCII = 0, /*US ASCII */ 1626 UTF8 = 1, /*UTF-8 Unicode encoding */ 1627 Reserved2 = 2, /*reserved for later use */ 1628 Reserved3 = 3, /*reserved for later use */ 1629 Reserved4 = 4, /*reserved for later use */ 1630 Reserved5 = 5, /*reserved for later use */ 1631 Reserved6 = 6, /*reserved for later use */ 1632 Reserved7 = 7, /*reserved for later use */ 1633 Reserved8 = 8, /*reserved for later use */ 1634 Reserved9 = 9, /*reserved for later use */ 1635 Reserved10 = 10, /*reserved for later use */ 1636 Reserved11 = 11, /*reserved for later use */ 1637 Reserved12 = 12, /*reserved for later use */ 1638 Reserved13 = 13, /*reserved for later use */ 1639 Reserved14 = 14, /*reserved for later use */ 1640 Reserved15 = 15 /*reserved for later use */ 1641 } 1642 1643 enum H5T_NCSET = H5TCset.Reserved2 ; /*Number of character sets actually defined */ 1644 1645 /* 1646 * Type of padding to use in character strings. Do not change these values 1647 * since they appear in HDF5 files! 1648 */ 1649 enum H5TString { 1650 Error = -1, /*error */ 1651 Nullterm = 0, /*null terminate like in C */ 1652 Nullpas = 1, /*pad with nulls */ 1653 Spacepad = 2, /*pad with spaces like in Fortran */ 1654 Reserved3 = 3, /*reserved for later use */ 1655 Reserved4 = 4, /*reserved for later use */ 1656 Reserved5 = 5, /*reserved for later use */ 1657 Reserved6 = 6, /*reserved for later use */ 1658 Reserved7 = 7, /*reserved for later use */ 1659 Reserved8 = 8, /*reserved for later use */ 1660 Reserved9 = 9, /*reserved for later use */ 1661 Reserved10 = 10, /*reserved for later use */ 1662 Reserved11 = 11, /*reserved for later use */ 1663 Reserved12 = 12, /*reserved for later use */ 1664 Reserved13 = 13, /*reserved for later use */ 1665 Reserved14 = 14, /*reserved for later use */ 1666 Reserved15 = 15 /*reserved for later use */ 1667 } 1668 1669 enum H5T_NSTR = H5TString.Reserved3; /*num H5TString types actually defined */ 1670 1671 /* Type of padding to use in other atomic types */ 1672 enum H5T_pad_t { 1673 H5T_PAD_ERROR = -1, /*error */ 1674 H5T_PAD_ZERO = 0, /*always set to zero */ 1675 H5T_PAD_ONE = 1, /*always set to one */ 1676 H5T_PAD_BACKGROUND = 2, /*set to background value */ 1677 1678 H5T_NPAD = 3 /*THIS MUST BE LAST */ 1679 } 1680 1681 /* Commands sent to conversion functions */ 1682 enum H5T_cmd_t { 1683 H5T_CONV_INIT = 0, /*query and/or initialize private data */ 1684 H5T_CONV_CONV = 1, /*convert data from source to dest datatype */ 1685 H5T_CONV_FREE = 2 /*function is being removed from path */ 1686 } 1687 1688 /* How is the `bkg' buffer used by the conversion function? */ 1689 enum H5T_bkg_t { 1690 H5T_BKG_NO = 0, /*background buffer is not needed, send NULL */ 1691 H5T_BKG_TEMP = 1, /*bkg buffer used as temp storage only */ 1692 H5T_BKG_YES = 2 /*init bkg buf with data before conversion */ 1693 } 1694 1695 /* Type conversion client data */ 1696 struct H5T_cdata_t { 1697 H5T_cmd_t command;/*what should the conversion function do? */ 1698 H5T_bkg_t need_bkg;/*is the background buffer needed? */ 1699 hbool_t recalc; /*recalculate private data */ 1700 void *priv; /*private data */ 1701 } 1702 1703 /* Conversion function persistence */ 1704 enum H5T_pers_t { 1705 H5T_PERS_DONTCARE = -1, /*wild card */ 1706 H5T_PERS_HARD = 0, /*hard conversion function */ 1707 H5T_PERS_SOFT = 1 /*soft conversion function */ 1708 } 1709 1710 /* The order to retrieve atomic native datatype */ 1711 enum H5TDirection 1712 { 1713 Default = 0, /*default direction is inscendent */ 1714 Ascend = 1, /*in inscendent order */ 1715 Descend = 2 /*in descendent order */ 1716 } 1717 1718 /* The exception type passed into the conversion callback function */ 1719 enum H5T_conv_except_t { 1720 H5T_CONV_EXCEPT_RANGE_HI = 0, /*source value is greater than destination's range */ 1721 H5T_CONV_EXCEPT_RANGE_LOW = 1, /*source value is less than destination's range */ 1722 H5T_CONV_EXCEPT_PRECISION = 2, /*source value loses precision in destination */ 1723 H5T_CONV_EXCEPT_TRUNCATE = 3, /*source value is truncated in destination */ 1724 H5T_CONV_EXCEPT_PINF = 4, /*source value is positive infinity(floating number) */ 1725 H5T_CONV_EXCEPT_NINF = 5, /*source value is negative infinity(floating number) */ 1726 H5T_CONV_EXCEPT_NAN = 6 /*source value is NaN(floating number) */ 1727 } 1728 1729 /* The return value from conversion callback function H5T_conv_except_func_t */ 1730 enum H5T_conv_ret_t { 1731 H5T_CONV_ABORT = -1, /*abort conversion */ 1732 H5T_CONV_UNHANDLED = 0, /*callback function failed to handle the exception */ 1733 H5T_CONV_HANDLED = 1 /*callback function handled the exception successfully */ 1734 } 1735 1736 /* Variable Length Datatype struct in memory */ 1737 /* (This is only used for VL sequences, not VL strings, which are stored in char *'s) */ 1738 struct hvl_t { 1739 size_t len; /* Length of VL data (in base type units) */ 1740 void *p; /* Pointer to VL data */ 1741 } 1742 1743 /* Variable Length String information */ 1744 enum H5T_VARIABLE = (cast(size_t)(-1)); /* Indicate that a string is variable length (null-terminated in C, instead of fixed length) */ 1745 1746 /* Opaque information */ 1747 enum H5T_OPAQUE_TAG_MAX = 256; /* Maximum length of an opaque tag */ 1748 /* This could be raised without too much difficulty */ 1749 1750 extern(C) 1751 { 1752 /* All datatype conversion functions are... */ 1753 alias H5T_conv_t = herr_t function(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 1754 size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, 1755 void *bkg, hid_t dset_xfer_plist); 1756 1757 /* Exception handler. If an exception like overflow happenes during conversion, 1758 * this function is called if it's registered through H5Pset_type_conv_cb. 1759 */ 1760 alias H5T_conv_except_func_t = H5T_conv_ret_t function(H5T_conv_except_t except_type, 1761 hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf, void *user_data); 1762 1763 1764 /* 1765 * The IEEE floating point types in various byte orders. 1766 */ 1767 alias H5T_IEEE_F32BE = H5T_IEEE_F32BE_g; 1768 alias H5T_IEEE_F32LE = H5T_IEEE_F32LE_g; 1769 alias H5T_IEEE_F64BE = H5T_IEEE_F64BE_g; 1770 alias H5T_IEEE_F64LE = H5T_IEEE_F64LE_g; 1771 extern __gshared hid_t H5T_IEEE_F32BE_g; 1772 extern __gshared hid_t H5T_IEEE_F32LE_g; 1773 extern __gshared hid_t H5T_IEEE_F64BE_g; 1774 extern __gshared hid_t H5T_IEEE_F64LE_g; 1775 1776 /* 1777 * These are "standard" types. For instance, signed (2's complement) and 1778 * unsigned integers of various sizes and byte orders. 1779 */ 1780 alias H5T_STD_I8BE = H5T_STD_I8BE_g; 1781 alias H5T_STD_I8LE = H5T_STD_I8LE_g; 1782 alias H5T_STD_I16BE = H5T_STD_I16BE_g; 1783 alias H5T_STD_I16LE = H5T_STD_I16LE_g; 1784 alias H5T_STD_I32BE = H5T_STD_I32BE_g; 1785 alias H5T_STD_I32LE = H5T_STD_I32LE_g; 1786 alias H5T_STD_I64BE = H5T_STD_I64BE_g; 1787 alias H5T_STD_I64LE = H5T_STD_I64LE_g; 1788 alias H5T_STD_U8BE = H5T_STD_U8BE_g; 1789 alias H5T_STD_U8LE = H5T_STD_U8LE_g; 1790 alias H5T_STD_U16BE = H5T_STD_U16BE_g; 1791 alias H5T_STD_U16LE = H5T_STD_U16LE_g; 1792 alias H5T_STD_U32BE = H5T_STD_U32BE_g; 1793 alias H5T_STD_U32LE = H5T_STD_U32LE_g; 1794 alias H5T_STD_U64BE = H5T_STD_U64BE_g; 1795 alias H5T_STD_U64LE = H5T_STD_U64LE_g; 1796 alias H5T_STD_B8BE = H5T_STD_B8BE_g; 1797 alias H5T_STD_B8LE = H5T_STD_B8LE_g; 1798 alias H5T_STD_B16BE = H5T_STD_B16BE_g; 1799 alias H5T_STD_B16LE = H5T_STD_B16LE_g; 1800 alias H5T_STD_B32BE = H5T_STD_B32BE_g; 1801 alias H5T_STD_B32LE = H5T_STD_B32LE_g; 1802 alias H5T_STD_B64BE = H5T_STD_B64BE_g; 1803 alias H5T_STD_B64LE = H5T_STD_B64LE_g; 1804 alias H5T_STD_REF_OBJ = H5T_STD_REF_OBJ_g; 1805 alias H5T_STD_REF_DSETREG = H5T_STD_REF_DSETREG_g; 1806 extern __gshared hid_t H5T_STD_I8BE_g; 1807 extern __gshared hid_t H5T_STD_I8LE_g; 1808 extern __gshared hid_t H5T_STD_I16BE_g; 1809 extern __gshared hid_t H5T_STD_I16LE_g; 1810 extern __gshared hid_t H5T_STD_I32BE_g; 1811 extern __gshared hid_t H5T_STD_I32LE_g; 1812 extern __gshared hid_t H5T_STD_I64BE_g; 1813 extern __gshared hid_t H5T_STD_I64LE_g; 1814 extern __gshared hid_t H5T_STD_U8BE_g; 1815 extern __gshared hid_t H5T_STD_U8LE_g; 1816 extern __gshared hid_t H5T_STD_U16BE_g; 1817 extern __gshared hid_t H5T_STD_U16LE_g; 1818 extern __gshared hid_t H5T_STD_U32BE_g; 1819 extern __gshared hid_t H5T_STD_U32LE_g; 1820 extern __gshared hid_t H5T_STD_U64BE_g; 1821 extern __gshared hid_t H5T_STD_U64LE_g; 1822 extern __gshared hid_t H5T_STD_B8BE_g; 1823 extern __gshared hid_t H5T_STD_B8LE_g; 1824 extern __gshared hid_t H5T_STD_B16BE_g; 1825 extern __gshared hid_t H5T_STD_B16LE_g; 1826 extern __gshared hid_t H5T_STD_B32BE_g; 1827 extern __gshared hid_t H5T_STD_B32LE_g; 1828 extern __gshared hid_t H5T_STD_B64BE_g; 1829 extern __gshared hid_t H5T_STD_B64LE_g; 1830 extern __gshared hid_t H5T_STD_REF_OBJ_g; 1831 extern __gshared hid_t H5T_STD_REF_DSETREG_g; 1832 1833 /* 1834 * Types which are particular to Unix. 1835 */ 1836 alias H5T_UNIX_D32BE = H5T_UNIX_D32BE_g; 1837 alias H5T_UNIX_D32LE = H5T_UNIX_D32LE_g; 1838 alias H5T_UNIX_D64BE = H5T_UNIX_D64BE_g; 1839 alias H5T_UNIX_D64LE = H5T_UNIX_D64LE_g; 1840 extern __gshared hid_t H5T_UNIX_D32BE_g; 1841 extern __gshared hid_t H5T_UNIX_D32LE_g; 1842 extern __gshared hid_t H5T_UNIX_D64BE_g; 1843 extern __gshared hid_t H5T_UNIX_D64LE_g; 1844 1845 /* 1846 * Types particular to the C language. String types use `bytes' instead 1847 * of `bits' as their size. 1848 */ 1849 alias H5T_C_S1 = H5T_C_S1_g; 1850 extern __gshared hid_t H5T_C_S1_g; 1851 1852 /* 1853 * Types particular to Fortran. 1854 */ 1855 alias H5T_FORTRAN_S1 = H5T_FORTRAN_S1_g; 1856 extern __gshared hid_t H5T_FORTRAN_S1_g; 1857 1858 1859 /* 1860 * These types are for Intel CPU's. They are little endian with IEEE 1861 * floating point. 1862 */ 1863 alias H5T_INTEL_I8 = H5T_STD_I8LE; 1864 alias H5T_INTEL_I16 = H5T_STD_I16LE; 1865 alias H5T_INTEL_I32 = H5T_STD_I32LE; 1866 alias H5T_INTEL_I64 = H5T_STD_I64LE; 1867 alias H5T_INTEL_U8 = H5T_STD_U8LE; 1868 alias H5T_INTEL_U16 = H5T_STD_U16LE; 1869 alias H5T_INTEL_U32 = H5T_STD_U32LE; 1870 alias H5T_INTEL_U64 = H5T_STD_U64LE; 1871 alias H5T_INTEL_B8 = H5T_STD_B8LE; 1872 alias H5T_INTEL_B16 = H5T_STD_B16LE; 1873 alias H5T_INTEL_B32 = H5T_STD_B32LE; 1874 alias H5T_INTEL_B64 = H5T_STD_B64LE; 1875 alias H5T_INTEL_F32 = H5T_IEEE_F32LE; 1876 alias H5T_INTEL_F64 = H5T_IEEE_F64LE; 1877 1878 1879 /* 1880 * The VAX floating point types (i.e. in VAX byte order) 1881 */ 1882 alias H5T_VAX_F32 = H5T_VAX_F32_g; 1883 alias H5T_VAX_F64 = H5T_VAX_F64_g; 1884 extern __gshared hid_t H5T_VAX_F32_g; 1885 extern __gshared hid_t H5T_VAX_F64_g; 1886 alias H5T_NATIVE_SCHAR = H5T_NATIVE_SCHAR_g; 1887 alias H5T_NATIVE_UCHAR = H5T_NATIVE_UCHAR_g; 1888 alias H5T_NATIVE_SHORT = H5T_NATIVE_SHORT_g; 1889 alias H5T_NATIVE_USHORT = H5T_NATIVE_USHORT_g; 1890 alias H5T_NATIVE_INT = H5T_NATIVE_INT_g; 1891 alias H5T_NATIVE_UINT = H5T_NATIVE_UINT_g; 1892 alias H5T_NATIVE_LONG = H5T_NATIVE_LONG_g; 1893 alias H5T_NATIVE_ULONG = H5T_NATIVE_ULONG_g; 1894 alias H5T_NATIVE_LLONG = H5T_NATIVE_LLONG_g; 1895 alias H5T_NATIVE_ULLONG = H5T_NATIVE_ULLONG_g; 1896 alias H5T_NATIVE_FLOAT = H5T_NATIVE_FLOAT_g; 1897 alias H5T_NATIVE_DOUBLE = H5T_NATIVE_DOUBLE_g; 1898 alias H5T_NATIVE_B8 = H5T_NATIVE_B8_g; 1899 alias H5T_NATIVE_B16 = H5T_NATIVE_B16_g; 1900 alias H5T_NATIVE_B32 = H5T_NATIVE_B32_g; 1901 alias H5T_NATIVE_B64 = H5T_NATIVE_B64_g; 1902 alias H5T_NATIVE_OPAQUE = H5T_NATIVE_OPAQUE_g; 1903 alias H5T_NATIVE_HADDR = H5T_NATIVE_HADDR_g; 1904 alias H5T_NATIVE_HSIZE = H5T_NATIVE_HSIZE_g; 1905 alias H5T_NATIVE_HSSIZE = H5T_NATIVE_HSSIZE_g; 1906 alias H5T_NATIVE_HERR = H5T_NATIVE_HERR_g; 1907 alias H5T_NATIVE_HBOOL = H5T_NATIVE_HBOOL_g; 1908 extern __gshared hid_t H5T_NATIVE_SCHAR_g; 1909 extern __gshared hid_t H5T_NATIVE_UCHAR_g; 1910 extern __gshared hid_t H5T_NATIVE_SHORT_g; 1911 extern __gshared hid_t H5T_NATIVE_USHORT_g; 1912 extern __gshared hid_t H5T_NATIVE_INT_g; 1913 extern __gshared hid_t H5T_NATIVE_UINT_g; 1914 extern __gshared hid_t H5T_NATIVE_LONG_g; 1915 extern __gshared hid_t H5T_NATIVE_ULONG_g; 1916 extern __gshared hid_t H5T_NATIVE_LLONG_g; 1917 extern __gshared hid_t H5T_NATIVE_ULLONG_g; 1918 extern __gshared hid_t H5T_NATIVE_FLOAT_g; 1919 extern __gshared hid_t H5T_NATIVE_DOUBLE_g; 1920 static if ( H5_SIZEOF_LONG_DOUBLE !=0 ) { 1921 extern __gshared hid_t H5T_NATIVE_LDOUBLE_g; 1922 } 1923 extern __gshared hid_t H5T_NATIVE_B8_g; 1924 extern __gshared hid_t H5T_NATIVE_B16_g; 1925 extern __gshared hid_t H5T_NATIVE_B32_g; 1926 extern __gshared hid_t H5T_NATIVE_B64_g; 1927 extern __gshared hid_t H5T_NATIVE_OPAQUE_g; 1928 extern __gshared hid_t H5T_NATIVE_HADDR_g; 1929 extern __gshared hid_t H5T_NATIVE_HSIZE_g; 1930 extern __gshared hid_t H5T_NATIVE_HSSIZE_g; 1931 extern __gshared hid_t H5T_NATIVE_HERR_g; 1932 extern __gshared hid_t H5T_NATIVE_HBOOL_g; 1933 1934 /* C9x integer types */ 1935 alias H5T_NATIVE_INT8 = H5T_NATIVE_INT8_g; 1936 alias H5T_NATIVE_UINT8 = H5T_NATIVE_UINT8_g; 1937 alias H5T_NATIVE_INT_LEAST8 = H5T_NATIVE_INT_LEAST8_g; 1938 alias H5T_NATIVE_UINT_LEAST8 = H5T_NATIVE_UINT_LEAST8_g; 1939 alias H5T_NATIVE_INT_FAST8 = H5T_NATIVE_INT_FAST8_g; 1940 alias H5T_NATIVE_UINT_FAST8 = H5T_NATIVE_UINT_FAST8_g; 1941 extern __gshared hid_t H5T_NATIVE_INT8_g; 1942 extern __gshared hid_t H5T_NATIVE_UINT8_g; 1943 extern __gshared hid_t H5T_NATIVE_INT_LEAST8_g; 1944 extern __gshared hid_t H5T_NATIVE_UINT_LEAST8_g; 1945 extern __gshared hid_t H5T_NATIVE_INT_FAST8_g; 1946 extern __gshared hid_t H5T_NATIVE_UINT_FAST8_g; 1947 1948 alias H5T_NATIVE_INT16 = H5T_NATIVE_INT16_g; 1949 alias H5T_NATIVE_UINT16 = H5T_NATIVE_UINT16_g; 1950 alias H5T_NATIVE_INT_LEAST16 = H5T_NATIVE_INT_LEAST16_g; 1951 alias H5T_NATIVE_UINT_LEAST16 = H5T_NATIVE_UINT_LEAST16_g; 1952 alias H5T_NATIVE_INT_FAST16 = H5T_NATIVE_INT_FAST16_g; 1953 alias H5T_NATIVE_UINT_FAST16 = H5T_NATIVE_UINT_FAST16_g; 1954 extern __gshared hid_t H5T_NATIVE_INT16_g; 1955 extern __gshared hid_t H5T_NATIVE_UINT16_g; 1956 extern __gshared hid_t H5T_NATIVE_INT_LEAST16_g; 1957 extern __gshared hid_t H5T_NATIVE_UINT_LEAST16_g; 1958 extern __gshared hid_t H5T_NATIVE_INT_FAST16_g; 1959 extern __gshared hid_t H5T_NATIVE_UINT_FAST16_g; 1960 1961 alias H5T_NATIVE_INT32 = H5T_NATIVE_INT32_g; 1962 alias H5T_NATIVE_UINT32 = H5T_NATIVE_UINT32_g; 1963 alias H5T_NATIVE_INT_LEAST32 = H5T_NATIVE_INT_LEAST32_g; 1964 alias H5T_NATIVE_UINT_LEAST32 = H5T_NATIVE_UINT_LEAST32_g; 1965 alias H5T_NATIVE_INT_FAST32 = H5T_NATIVE_INT_FAST32_g; 1966 alias H5T_NATIVE_UINT_FAST32 = H5T_NATIVE_UINT_FAST32_g; 1967 extern __gshared hid_t H5T_NATIVE_INT32_g; 1968 extern __gshared hid_t H5T_NATIVE_UINT32_g; 1969 extern __gshared hid_t H5T_NATIVE_INT_LEAST32_g; 1970 extern __gshared hid_t H5T_NATIVE_UINT_LEAST32_g; 1971 extern __gshared hid_t H5T_NATIVE_INT_FAST32_g; 1972 extern __gshared hid_t H5T_NATIVE_UINT_FAST32_g; 1973 1974 alias H5T_NATIVE_INT64 = H5T_NATIVE_INT64_g; 1975 alias H5T_NATIVE_UINT64 = H5T_NATIVE_UINT64_g; 1976 alias H5T_NATIVE_INT_LEAST64 = H5T_NATIVE_INT_LEAST64_g; 1977 alias H5T_NATIVE_UINT_LEAST64 = H5T_NATIVE_UINT_LEAST64_g; 1978 alias H5T_NATIVE_INT_FAST64 = H5T_NATIVE_INT_FAST64_g; 1979 alias H5T_NATIVE_UINT_FAST64 = H5T_NATIVE_UINT_FAST64_g; 1980 extern __gshared hid_t H5T_NATIVE_INT64_g; 1981 extern __gshared hid_t H5T_NATIVE_UINT64_g; 1982 extern __gshared hid_t H5T_NATIVE_INT_LEAST64_g; 1983 extern __gshared hid_t H5T_NATIVE_UINT_LEAST64_g; 1984 extern __gshared hid_t H5T_NATIVE_INT_FAST64_g; 1985 extern __gshared hid_t H5T_NATIVE_UINT_FAST64_g; 1986 1987 version(Posix) { 1988 1989 /* Operations defined on all datatypes */ 1990 hid_t H5Tcreate(H5TClass type, size_t size); 1991 hid_t H5Tcopy(hid_t type_id); 1992 herr_t H5Tclose(hid_t type_id); 1993 htri_t H5Tequal(hid_t type1_id, hid_t type2_id); 1994 herr_t H5Tlock(hid_t type_id); 1995 herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, 1996 hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id); 1997 hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id); 1998 herr_t H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id); 1999 hid_t H5Tget_create_plist(hid_t type_id); 2000 htri_t H5Tcommitted(hid_t type_id); 2001 herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc); 2002 hid_t H5Tdecode(const void *buf); 2003 2004 /* Operations defined on compound datatypes */ 2005 herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset, 2006 hid_t member_id); 2007 herr_t H5Tpack(hid_t type_id); 2008 2009 /* Operations defined on enumeration datatypes */ 2010 hid_t H5Tenum_create(hid_t base_id); 2011 herr_t H5Tenum_insert(hid_t type, const char *name, const void *value); 2012 herr_t H5Tenum_nameof(hid_t type, const void *value, char *name/*out*/, 2013 size_t size); 2014 herr_t H5Tenum_valueof(hid_t type, const char *name, 2015 void *value/*out*/); 2016 2017 /* Operations defined on variable-length datatypes */ 2018 hid_t H5Tvlen_create(hid_t base_id); 2019 2020 /* Operations defined on array datatypes */ 2021 hid_t H5Tarray_create2(hid_t base_id, uint ndims, 2022 const hsize_t dim[/* ndims */]); 2023 int H5Tget_array_ndims(hid_t type_id); 2024 int H5Tget_array_dims2(hid_t type_id, hsize_t* dims); 2025 2026 /* Operations defined on opaque datatypes */ 2027 herr_t H5Tset_tag(hid_t type, const char *tag); 2028 char *H5Tget_tag(hid_t type); 2029 2030 /* Querying property values */ 2031 hid_t H5Tget_super(hid_t type); 2032 H5TClass H5Tget_class(hid_t type_id); 2033 htri_t H5Tdetect_class(hid_t type_id, H5TClass cls); 2034 size_t H5Tget_size(hid_t type_id); 2035 H5TByteOrder H5Tget_order(hid_t type_id); 2036 size_t H5Tget_precision(hid_t type_id); 2037 int H5Tget_offset(hid_t type_id); 2038 herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, 2039 H5T_pad_t *msb/*out*/); 2040 H5T_sign_t H5Tget_sign(hid_t type_id); 2041 herr_t H5Tget_fields(hid_t type_id, size_t *spos/*out*/, 2042 size_t *epos/*out*/, size_t *esize/*out*/, 2043 size_t *mpos/*out*/, size_t *msize/*out*/); 2044 size_t H5Tget_ebias(hid_t type_id); 2045 H5T_norm_t H5Tget_norm(hid_t type_id); 2046 H5T_pad_t H5Tget_inpad(hid_t type_id); 2047 H5TString H5Tget_strpad(hid_t type_id); 2048 int H5Tget_nmembers(hid_t type_id); 2049 char *H5Tget_member_name(hid_t type_id, uint membno); 2050 int H5Tget_member_index(hid_t type_id, const char *name); 2051 size_t H5Tget_member_offset(hid_t type_id, uint membno); 2052 H5TClass H5Tget_member_class(hid_t type_id, uint membno); 2053 hid_t H5Tget_member_type(hid_t type_id, uint membno); 2054 herr_t H5Tget_member_value(hid_t type_id, uint membno, void *value/*out*/); 2055 H5TCset H5Tget_cset(hid_t type_id); 2056 htri_t H5Tis_variable_str(hid_t type_id); 2057 hid_t H5Tget_native_type(hid_t type_id, H5TDirection direction); 2058 2059 /* Setting property values */ 2060 herr_t H5Tset_size(hid_t type_id, size_t size); 2061 herr_t H5Tset_order(hid_t type_id, H5TByteOrder order); 2062 herr_t H5Tset_precision(hid_t type_id, size_t prec); 2063 herr_t H5Tset_offset(hid_t type_id, size_t offset); 2064 herr_t H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb); 2065 herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign); 2066 herr_t H5Tset_fields(hid_t type_id, size_t spos, size_t epos, 2067 size_t esize, size_t mpos, size_t msize); 2068 herr_t H5Tset_ebias(hid_t type_id, size_t ebias); 2069 herr_t H5Tset_norm(hid_t type_id, H5T_norm_t norm); 2070 herr_t H5Tset_inpad(hid_t type_id, H5T_pad_t pad); 2071 herr_t H5Tset_cset(hid_t type_id, H5TCset cset); 2072 herr_t H5Tset_strpad(hid_t type_id, H5TString strpad); 2073 2074 /* Type conversion database */ 2075 herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, 2076 hid_t dst_id, H5T_conv_t func); 2077 herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, 2078 hid_t dst_id, H5T_conv_t func); 2079 H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata); 2080 htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id); 2081 herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, 2082 void *buf, void *background, hid_t plist_id); 2083 } 2084 } 2085 2086 // alias H5ZFilter = int; 2087 2088 /* Filter IDs */ 2089 enum H5ZFilter 2090 { 2091 Error = (-1), /*no filter */ 2092 None = 0, /*reserved indefinitely */ 2093 Deflate = 1, /*deflation like gzip */ 2094 Shuffle = 2, /*shuffle the data */ 2095 Fletcher32 = 3, /*fletcher32 checksum of EDC */ 2096 SZip = 4, /*szip compression */ 2097 NBit = 5, /*nbit compression */ 2098 ScaleOffset = 6, /*scale+offset compression */ 2099 Reserved = 256, /*filter ids below this value are reserved for library use */ 2100 Max = 65535, /*maximum filter id */ 2101 All = 0, /* Symbol to remove all filters in H5Premove_filter */ 2102 } 2103 2104 enum H5Z_MAX_NFILTERS = 32; /* Maximum number of filters allowed in a pipeline */ 2105 /* (should probably be allowed to be an 2106 * unlimited amount, but currently each 2107 * filter uses a bit in a 32-bit field, 2108 * so the format would have to be 2109 * changed to accomodate that) 2110 */ 2111 2112 /* Flags for filter definition (stored) */ 2113 enum H5Z_FLAG_DEFMASK = 0x00ff; /*definition flag mask */ 2114 enum H5Z_FLAG_MANDATORY = 0x0000; /*filter is mandatory */ 2115 enum H5Z_FLAG_OPTIONAL = 0x0001; /*filter is optional */ 2116 2117 /* Additional flags for filter invocation (not stored) */ 2118 enum H5Z_FLAG_INVMASK = 0xff00; /*invocation flag mask */ 2119 enum H5Z_FLAG_REVERSE = 0x0100; /*reverse direction; read */ 2120 enum H5Z_FLAG_SKIP_EDC = 0x0200; /*skip EDC filters for read */ 2121 2122 /* Special parameters for szip compression */ 2123 /* [These are aliases for the similar definitions in szlib.h, which we can't 2124 * include directly due to the duplication of various symbols with the zlib.h 2125 * header file] */ 2126 enum H5_SZIP_ALLOW_K13_OPTION_MASK = 1; 2127 enum H5_SZIP_CHIP_OPTION_MASK = 2; 2128 enum H5_SZIP_EC_OPTION_MASK = 4; 2129 enum H5_SZIP_NN_OPTION_MASK = 32; 2130 enum H5_SZIP_MAX_PIXELS_PER_BLOCK = 32; 2131 2132 /* Macros for the shuffle filter */ 2133 enum H5Z_SHUFFLE_USER_NPARMS = 0; /* Number of parameters that users can set */ 2134 enum H5Z_SHUFFLE_TOTAL_NPARMS = 1; /* Total number of parameters for filter */ 2135 2136 /* Macros for the szip filter */ 2137 enum H5Z_SZIP_USER_NPARMS = 2; /* Number of parameters that users can set */ 2138 enum H5Z_SZIP_TOTAL_NPARMS = 4; /* Total number of parameters for filter */ 2139 enum H5Z_SZIP_PARM_MASK = 0; /* "User" parameter for option mask */ 2140 enum H5Z_SZIP_PARM_PPB = 1; /* "User" parameter for pixels-per-block */ 2141 enum H5Z_SZIP_PARM_BPP = 2; /* "Local" parameter for bits-per-pixel */ 2142 enum H5Z_SZIP_PARM_PPS = 3; /* "Local" parameter for pixels-per-scanline */ 2143 2144 /* Macros for the nbit filter */ 2145 enum H5Z_NBIT_USER_NPARMS = 0; /* Number of parameters that users can set */ 2146 2147 /* Macros for the scale offset filter */ 2148 enum H5Z_SCALEOFFSET_USER_NPARMS = 2; /* Number of parameters that users can set */ 2149 2150 /* Special parameters for ScaleOffset filter*/ 2151 enum H5Z_SO_INT_MINBITS_DEFAULT = 0; 2152 enum H5Z_SO_scale_type_t { 2153 H5Z_SO_FLOAT_DSCALE = 0, 2154 H5Z_SO_FLOAT_ESCALE = 1, 2155 H5Z_SO_INT = 2 2156 } 2157 2158 /* Current version of the H5Z_class_t struct */ 2159 enum H5Z_CLASS_T_VERS = (1); 2160 2161 /* Values to decide if EDC is enabled for reading data */ 2162 enum H5Z_EDC_t { 2163 H5Z_ERROR_EDC = -1, /* error value */ 2164 H5Z_DISABLE_EDC = 0, 2165 H5Z_ENABLE_EDC = 1, 2166 H5Z_NO_EDC = 2 /* must be the last */ 2167 } 2168 2169 /* Bit flags for H5Zget_filter_info */ 2170 enum H5Z_FILTER_CONFIG_ENCODE_ENABLED = (0x0001); 2171 enum H5Z_FILTER_CONFIG_DECODE_ENABLED = (0x0002); 2172 2173 /* Return values for filter callback function */ 2174 enum H5Z_cb_return_t { 2175 H5Z_CB_ERROR = -1, 2176 H5Z_CB_FAIL = 0, /* I/O should fail if filter fails. */ 2177 H5Z_CB_CONT = 1, /* I/O continues if filter fails. */ 2178 H5Z_CB_NO = 2 2179 } 2180 2181 extern(C) 2182 { 2183 /* Filter callback function definition */ 2184 alias H5Z_filter_func_t = H5Z_cb_return_t function(H5ZFilter filter, void* buf, 2185 size_t buf_size, void* op_data); 2186 2187 /* Structure for filter callback property */ 2188 struct H5Z_cb_t { 2189 H5Z_filter_func_t func; 2190 void* op_data; 2191 } 2192 alias H5Z_can_apply_func_t = htri_t function(hid_t dcpl_id, hid_t type_id, hid_t space_id); 2193 alias H5Z_set_local_func_t = herr_t function(hid_t dcpl_id, hid_t type_id, hid_t space_id); 2194 alias H5Z_func_t = size_t function(uint flags, size_t cd_nelmts, const uint* cd_values, size_t nbytes, size_t *buf_size, void **buf); 2195 2196 struct H5Z_class2_t { 2197 int _version; /* Version number of the H5Z_class_t struct */ 2198 H5ZFilter id; /* Filter ID number */ 2199 int encoder_present; /* Does this filter have an encoder? */ 2200 int decoder_present; /* Does this filter have a decoder? */ 2201 const char *name; /* Comment for debugging */ 2202 H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ 2203 H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ 2204 H5Z_func_t filter; /* The actual filter function */ 2205 } 2206 2207 herr_t H5Zregister(const void *cls); 2208 herr_t H5Zunregister(H5ZFilter id); 2209 htri_t H5Zfilter_avail(H5ZFilter id); 2210 herr_t H5Zget_filter_info(H5ZFilter filter, uint *filter_config_flags); 2211 } 2212 2213 2214 alias MPI_Datatype = int; 2215 alias MPI_Comm = int; 2216 alias MPI_Info = int; 2217 enum MPI_LONG_LONG_INT = cast(MPI_Datatype) 0x4c000809; 2218 enum H5_CLEAR_MEMORY = 1; 2219 enum H5_CONVERT_DENORMAL_FLOAT = 1; 2220 enum H5_DEFAULT_PLUGINDIR = "/usr/local/hdf5/lib/plugin"; 2221 enum H5_DEV_T_IS_SCALAR = 1; 2222 enum H5_FP_TO_INTEGER_OVERFLOW_WORKS = 1; 2223 enum H5_FP_TO_ULLONG_ACCURATE = 1; 2224 enum H5_FP_TO_ULLONG_RIGHT_MAXIMUM = 1; 2225 enum H5_GETTIMEOFDAY_GIVES_TZ = 1; 2226 enum H5_HAVE_ALARM = 1; 2227 enum H5_HAVE_ATTRIBUTE = 1; 2228 enum H5_HAVE_C99_DESIGNATED_INITIALIZER = 1; 2229 enum H5_HAVE_C99_FUNC = 1; 2230 enum H5_HAVE_CLOCK_GETTIME = 1; 2231 enum H5_HAVE_DIFFTIME = 1; 2232 enum H5_HAVE_DIRENT_H = 1; 2233 enum H5_HAVE_DLFCN_H = 1; 2234 enum H5_HAVE_EMBEDDED_LIBINFO = 1; 2235 enum H5_HAVE_FEATURES_H = 1; 2236 enum H5_HAVE_FILTER_DEFLATE = 1; 2237 enum H5_HAVE_FILTER_FLETCHER32 = 1; 2238 enum H5_HAVE_FILTER_NBIT = 1; 2239 enum H5_HAVE_FILTER_SCALEOFFSET = 1; 2240 enum H5_HAVE_FILTER_SHUFFLE = 1; 2241 enum H5_HAVE_FORK = 1; 2242 enum H5_HAVE_FREXPF = 1; 2243 enum H5_HAVE_FREXPL = 1; 2244 enum H5_HAVE_FSEEKO = 1; 2245 enum H5_HAVE_FSEEKO64 = 1; 2246 enum H5_HAVE_FSTAT64 = 1; 2247 enum H5_HAVE_FTELLO = 1; 2248 enum H5_HAVE_FTELLO64 = 1; 2249 enum H5_HAVE_FTRUNCATE64 = 1; 2250 enum H5_HAVE_FUNCTION = 1; 2251 enum H5_HAVE_GETHOSTNAME = 1; 2252 enum H5_HAVE_GETPWUID = 1; 2253 enum H5_HAVE_GETRUSAGE = 1; 2254 enum H5_HAVE_GETTIMEOFDAY = 1; 2255 enum H5_HAVE_INTTYPES_H = 1; 2256 enum H5_HAVE_IOCTL = 1; 2257 enum H5_HAVE_LIBDL = 1; 2258 enum H5_HAVE_LIBM = 1; 2259 enum H5_HAVE_LIBZ = 1; 2260 enum H5_HAVE_LONGJMP = 1; 2261 enum H5_HAVE_LSEEK64 = 1; 2262 enum H5_HAVE_LSTAT = 1; 2263 enum H5_HAVE_MEMORY_H = 1; 2264 enum H5_HAVE_MPI_GET_SIZE = 1; 2265 enum H5_HAVE_MPI_MULTI_LANG_Comm = 1; 2266 enum H5_HAVE_MPI_MULTI_LANG_Info = 1; 2267 enum H5_HAVE_PARALLEL = 1; 2268 enum H5_HAVE_RANDOM = 1; 2269 enum H5_HAVE_RAND_R = 1; 2270 enum H5_HAVE_SETJMP = 1; 2271 enum H5_HAVE_SETJMP_H = 1; 2272 enum H5_HAVE_SIGLONGJMP = 1; 2273 enum H5_HAVE_SIGNAL = 1; 2274 enum H5_HAVE_SIGPROCMASK = 1; 2275 enum H5_HAVE_SNPRINTF = 1; 2276 enum H5_HAVE_SRANDOM = 1; 2277 enum H5_HAVE_STAT64 = 1; 2278 enum H5_HAVE_STAT_ST_BLOCKS = 1; 2279 enum H5_HAVE_STDDEF_H = 1; 2280 enum H5_HAVE_STDINT_H = 1; 2281 enum H5_HAVE_STDLIB_H = 1; 2282 enum H5_HAVE_STRDUP = 1; 2283 enum H5_HAVE_STRINGS_H = 1; 2284 enum H5_HAVE_STRING_H = 1; 2285 enum H5_HAVE_STRUCT_TIMEZONE = 1; 2286 enum H5_HAVE_STRUCT_TM_TM_ZONE = 1; 2287 enum H5_HAVE_SYMLINK = 1; 2288 enum H5_HAVE_SYSTEM = 1; 2289 enum H5_HAVE_SYS_IOCTL_H = 1; 2290 enum H5_HAVE_SYS_RESOURCE_H = 1; 2291 enum H5_HAVE_SYS_SOCKET_H = 1; 2292 enum H5_HAVE_SYS_STAT_H = 1; 2293 enum H5_HAVE_SYS_TIMEB_H = 1; 2294 enum H5_HAVE_SYS_TIME_H = 1; 2295 enum H5_HAVE_SYS_TYPES_H = 1; 2296 enum H5_HAVE_TIOCGETD = 1; 2297 enum H5_HAVE_TIOCGWINSZ = 1; 2298 enum H5_HAVE_TMPFILE = 1; 2299 enum H5_HAVE_TM_GMTOFF = 1; 2300 enum H5_HAVE_TM_ZONE = 1; 2301 enum H5_HAVE_UNISTD_H = 1; 2302 enum H5_HAVE_VASPRINTF = 1; 2303 enum H5_HAVE_VSNPRINTF = 1; 2304 enum H5_HAVE_WAITPID = 1; 2305 enum H5_HAVE_ZLIB_H = 1; 2306 enum H5_INCLUDE_HL = 1; 2307 enum H5_INTEGER_TO_LDOUBLE_ACCURATE = 1; 2308 enum H5_LDOUBLE_TO_INTEGER_ACCURATE = 1; 2309 enum H5_LDOUBLE_TO_INTEGER_WORKS = 1; 2310 enum H5_LDOUBLE_TO_LLONG_ACCURATE = 1; 2311 enum H5_LDOUBLE_TO_UINT_ACCURATE = 1; 2312 enum H5_LLONG_TO_FP_CAST_WORKS = 1; 2313 enum H5_LLONG_TO_LDOUBLE_CORRECT = 1; 2314 enum H5_LT_OBJDIR = ".libs/"; 2315 enum H5_MPI_FILE_SET_SIZE_BIG = 1; 2316 enum H5_NO_ALIGNMENT_RESTRICTIONS = 1; 2317 enum H5_PACKAGE = "hdf5"; 2318 enum H5_PACKAGE_BUGREPORT = "help@hdfgroup.org"; 2319 enum H5_PACKAGE_NAME = "HDF5"; 2320 enum H5_PACKAGE_STRING = "HDF5 1.8.13"; 2321 enum H5_PACKAGE_TARNAME = "hdf5"; 2322 enum H5_PACKAGE_URL = ""; 2323 enum H5_PACKAGE_VERSION = "1.8.13"; 2324 enum H5_PRINTF_LL_WIDTH = "l"; 2325 enum H5_SIZEOF_CHAR = 1; 2326 enum H5_SIZEOF_DOUBLE = 8; 2327 enum H5_SIZEOF_FLOAT = 4; 2328 enum H5_SIZEOF_INT = 4; 2329 enum H5_SIZEOF_INT16_T = 2; 2330 enum H5_SIZEOF_INT32_T = 4; 2331 enum H5_SIZEOF_INT64_T = 8; 2332 enum H5_SIZEOF_INT8_T = 1; 2333 enum H5_SIZEOF_INT_FAST16_T = 8; 2334 enum H5_SIZEOF_INT_FAST32_T = 8; 2335 enum H5_SIZEOF_INT_FAST64_T = 8; 2336 enum H5_SIZEOF_INT_FAST8_T = 1; 2337 enum H5_SIZEOF_INT_LEAST16_T = 2; 2338 enum H5_SIZEOF_INT_LEAST32_T = 4; 2339 enum H5_SIZEOF_INT_LEAST64_T = 8; 2340 enum H5_SIZEOF_INT_LEAST8_T = 1; 2341 enum H5_SIZEOF_LONG = 8; 2342 enum H5_SIZEOF_LONG_DOUBLE = 16; 2343 enum H5_SIZEOF_LONG_LONG = 8; 2344 enum H5_SIZEOF_OFF64_T = 8; 2345 enum H5_SIZEOF_OFF_T = 8; 2346 enum H5_SIZEOF_PTRDIFF_T = 8; 2347 enum H5_SIZEOF_SHORT = 2; 2348 enum H5_SIZEOF_SIZE_T = 8; 2349 enum H5_SIZEOF_SSIZE_T = 8; 2350 enum H5_SIZEOF_UINT16_T = 2; 2351 enum H5_SIZEOF_UINT32_T = 4; 2352 enum H5_SIZEOF_UINT64_T = 8; 2353 enum H5_SIZEOF_UINT8_T = 1; 2354 enum H5_SIZEOF_UINT_FAST16_T = 8; 2355 enum H5_SIZEOF_UINT_FAST32_T = 8; 2356 enum H5_SIZEOF_UINT_FAST64_T = 8; 2357 enum H5_SIZEOF_UINT_FAST8_T = 1; 2358 enum H5_SIZEOF_UINT_LEAST16_T = 2; 2359 enum H5_SIZEOF_UINT_LEAST32_T = 4; 2360 enum H5_SIZEOF_UINT_LEAST64_T = 8; 2361 enum H5_SIZEOF_UINT_LEAST8_T = 1; 2362 enum H5_SIZEOF_UNSIGNED = 4; 2363 enum H5_SIZEOF___INT64 = 0; 2364 enum H5_STDC_HEADERS = 1; 2365 enum H5_SYSTEM_SCOPE_THREADS = 1; 2366 enum H5_TIME_WITH_SYS_TIME = 1; 2367 enum H5_ULLONG_TO_FP_CAST_WORKS = 1; 2368 enum H5_ULLONG_TO_LDOUBLE_PRECISION = 1; 2369 enum H5_ULONG_TO_FLOAT_ACCURATE = 1; 2370 enum H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE = 1; 2371 enum H5_VERSION = "1.8.13"; 2372 enum H5_VSNPRINTF_WORKS = 1; 2373 enum H5_WANT_DATA_ACCURACY = 1; 2374 enum H5_WANT_DCONV_EXCEPTION = 1; 2375 enum WORDS_BIGENDIAN = 0; 2376